Skip to content

Commit aef9d6b

Browse files
authored
Rollup merge of rust-lang#134743 - jyn514:rustc-dev-short-backtraces, r=jieyouxu
Default to short backtraces for dev builds of rustc itself A dev build almost certainly means that whoever's built the compiler has the opportunity to rerun it to collect a more complete trace. So we don't need to default to a complete trace; we should hide irrelevant details by default.
2 parents 68b9e4f + c7a28d5 commit aef9d6b

File tree

1 file changed

+5
-1
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+5
-1
lines changed

compiler/rustc_driver_impl/src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,11 @@ pub fn install_ice_hook(
13881388
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
13891389
// (e.g. `RUST_BACKTRACE=1`)
13901390
if env::var_os("RUST_BACKTRACE").is_none() {
1391-
panic::set_backtrace_style(panic::BacktraceStyle::Full);
1391+
if env!("CFG_RELEASE_CHANNEL") == "dev" {
1392+
panic::set_backtrace_style(panic::BacktraceStyle::Short);
1393+
} else {
1394+
panic::set_backtrace_style(panic::BacktraceStyle::Full);
1395+
}
13921396
}
13931397

13941398
let using_internal_features = Arc::new(std::sync::atomic::AtomicBool::default());

0 commit comments

Comments
 (0)