Skip to content

Commit

Permalink
Rollup merge of rust-lang#77493 - hosseind88:ICEs_should_always_print…
Browse files Browse the repository at this point in the history
…_the_top_of_the_query_stack, r=oli-obk

ICEs should always print the top of the query stack

see rust-lang#76920
  • Loading branch information
Dylan-DPC authored Oct 16, 2020
2 parents 2c1e8cf + ab0fc47 commit d2feccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
// If backtraces are enabled, also print the query stack
let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");

if backtrace {
TyCtxt::try_print_query_stack(&handler);
}
let num_frames = if backtrace { None } else { Some(2) };

TyCtxt::try_print_query_stack(&handler, num_frames);
}

fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> {
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/custom_ice_message.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy

note: Clippy version: foo

query stack during panic:
end of query stack

0 comments on commit d2feccc

Please sign in to comment.