Skip to content

Commit d2feccc

Browse files
authored
Rollup merge of rust-lang#77493 - hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk
ICEs should always print the top of the query stack see rust-lang#76920
2 parents 2c1e8cf + ab0fc47 commit d2feccc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/driver.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
277277
// If backtraces are enabled, also print the query stack
278278
let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
279279

280-
if backtrace {
281-
TyCtxt::try_print_query_stack(&handler);
282-
}
280+
let num_frames = if backtrace { None } else { Some(2) };
281+
282+
TyCtxt::try_print_query_stack(&handler, num_frames);
283283
}
284284

285285
fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> {

tests/ui/custom_ice_message.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy
99

1010
note: Clippy version: foo
1111

12+
query stack during panic:
13+
end of query stack

0 commit comments

Comments
 (0)