8000 Fix double panic when printing query stack during an ICE by Aaron1011 · Pull Request #64799 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Fix double panic when printing query stack during an ICE #64799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add note about global state in try_print_query_stack
  • Loading branch information
Aaron1011 authored Sep 26, 2019
commit 97906bcd5c9c5ba5d165c7330b2ee062a97f11cf
3 changes: 3 additions & 0 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ impl<'tcx> TyCtxt<'tcx> {
pub fn try_print_query_stack(handler: &Handler) {
eprintln!("query stack during panic:");

// Be careful reyling on global state here: this code is called from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Be careful reyling on global state here: this code is called from
// Be careful relying on global state here: this code is called from

// a panic hook, which means that the global `Handler` may be in a weird
// state if it was responsible for triggering the panic.
tls::with_context_opt(|icx| {
if let Some(icx) = icx {
let mut current_query = icx.query.clone();
Expand Down
0