diff options
| author | hosseind75 <dindar95@bk.ru> | 2020-09-19 18:37:58 +0430 |
|---|---|---|
| committer | hosseind88 <hosseind88@mail.ru> | 2020-10-09 20:57:45 +0330 |
| commit | a9053e4baf251f53d8d6b95cd3f5b8a829ad0ba6 (patch) | |
| tree | 21c112bed9b03478b8255575f2a5d8038078cf70 | |
| parent | ecd308ec394f9d01b4392ee0315ea64d52ab7caa (diff) | |
| download | rust-a9053e4baf251f53d8d6b95cd3f5b8a829ad0ba6.tar.gz rust-a9053e4baf251f53d8d6b95cd3f5b8a829ad0ba6.zip | |
run full query stack print just when RUST_BACKTRACE is set
| -rw-r--r-- | src/driver.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/driver.rs b/src/driver.rs index c88dffc88f4..0b324775b0d 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -274,7 +274,10 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) { handler.note_without_error(¬e); } - TyCtxt::try_print_query_stack(&handler, Some(2)); + // If backtraces are enabled, also print the query stack + let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0"); + + TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace)); } fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> { |
