Avoid calling queries during query stack printing

This commit is contained in:
Oli Scherer 2023-06-27 09:07:14 +00:00 committed by Philipp Krones
parent 5d3377dd67
commit b0142f603d
No known key found for this signature in database
GPG key ID: 1CA0DF2AF59D68A5
5 changed files with 38 additions and 13 deletions

View file

@ -349,7 +349,12 @@ pub fn try_print_query_stack(handler: &Handler, num_frames: Option<usize>) {
// state if it was responsible for triggering the panic.
let i = ty::tls::with_context_opt(|icx| {
if let Some(icx) = icx {
print_query_stack(QueryCtxt::new(icx.tcx), icx.query, handler, num_frames)
ty::print::with_no_queries!(print_query_stack(
QueryCtxt::new(icx.tcx),
icx.query,
handler,
num_frames
))
} else {
0
}