Skip to content

Commit 97906bc

Browse files
authored
Add note about global state in try_print_query_stack
1 parent e9aa0e7 commit 97906bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/ty/query/plumbing.rs

+3
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ impl<'tcx> TyCtxt<'tcx> {
325325
pub fn try_print_query_stack(handler: &Handler) {
326326
eprintln!("query stack during panic:");
327327

328+
// Be careful reyling on global state here: this code is called from
329+
// a panic hook, which means that the global `Handler` may be in a weird
330+
// state if it was responsible for triggering the panic.
328331
tls::with_context_opt(|icx| {
329332
if let Some(icx) = icx {
330333
let mut current_query = icx.query.clone();

0 commit comments

Comments
 (0)