Skip to content

Commit a9053e4

Browse files
hosseind75hosseind88
authored and
hosseind88
committed
run full query stack print just when RUST_BACKTRACE is set
1 parent ecd308e commit a9053e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/driver.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
274274
handler.note_without_error(&note);
275275
}
276276

277-
TyCtxt::try_print_query_stack(&handler, Some(2));
277+
// If backtraces are enabled, also print the query stack
278+
let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
279+
280+
TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace));
278281
}
279282

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

0 commit comments

Comments
 (0)