Skip to content

Commit 963e951

Browse files
authored
Rollup merge of #125063 - tbu-:pr_set_ice_hook_env, r=michaelwoerister
Don't call `env::set_var` in `rustc_driver::install_ice_hook` Modifying an environment variable would make the function unsafe to call.
2 parents c0dcb18 + b98b8d7 commit 963e951

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+3
-2
lines changed

compiler/rustc_driver_impl/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![allow(internal_features)]
1212
#![feature(decl_macro)]
1313
#![feature(let_chains)]
14+
#![feature(panic_backtrace_config)]
1415
#![feature(panic_update_hook)]
1516
#![feature(result_flattening)]
1617

@@ -1317,8 +1318,8 @@ pub fn install_ice_hook(
13171318
// by the user. Compiler developers and other rustc users can
13181319
// opt in to less-verbose backtraces by manually setting "RUST_BACKTRACE"
13191320
// (e.g. `RUST_BACKTRACE=1`)
1320-
if std::env::var_os("RUST_BACKTRACE").is_none() {
1321-
std::env::set_var("RUST_BACKTRACE", "full");
1321+
if env::var_os("RUST_BACKTRACE").is_none() {
1322+
panic::set_backtrace_style(panic::BacktraceStyle::Full);
13221323
}
13231324

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

0 commit comments

Comments
 (0)