Skip to content

Commit

Permalink
Unrolled build for rust-lang#134743
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Dec 25, 2024
2 parents a0a5c42 + c7a28d5 commit 22cc2e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,11 @@ pub fn install_ice_hook(
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
// (e.g. `RUST_BACKTRACE=1`)
if env::var_os("RUST_BACKTRACE").is_none() {
panic::set_backtrace_style(panic::BacktraceStyle::Full);
if env!("CFG_RELEASE_CHANNEL") == "dev" {
panic::set_backtrace_style(panic::BacktraceStyle::Short);
} else {
panic::set_backtrace_style(panic::BacktraceStyle::Full);
}
}

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

0 comments on commit 22cc2e2

Please sign in to comment.