Use dynamic dispatch for queries

This commit is contained in:
John Kåre Alsaker 2023-02-07 08:32:30 +01:00
parent d3edfd18c7
commit 2fe28ae0a4
12 changed files with 384 additions and 253 deletions

View file

@ -318,7 +318,7 @@ 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 { tcx: icx.tcx }, icx.query, handler, num_frames)
print_query_stack(QueryCtxt::new(icx.tcx), icx.query, handler, num_frames)
} else {
0
}