Skip to content

Commit 992f54e

Browse files
authored
Unrolled build for rust-lang#125355
Rollup merge of rust-lang#125355 - michaelwoerister:rust_log_force_capture, r=nnethercote Use Backtrace::force_capture instead of Backtrace::capture in rustc_log After rust-lang#125063, the compiler and custom drivers won't automatically set the RUST_BACKTRACE environment variable anymore, so we have to call `Backtrace::force_capture` instead of `Backtrace::capture` to unconditionally capture a backtrace. rustc_log handles enabling backtraces via env vars itself, so we don't want RUST_BACKTRACE to make a difference.
2 parents 93e7cb8 + 8f11f48 commit 992f54e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: compiler/rustc_log/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ where
159159
if !target.contains(&self.backtrace_target) {
160160
return Ok(());
161161
}
162-
let backtrace = std::backtrace::Backtrace::capture();
162+
// Use Backtrace::force_capture because we don't want to depend on the
163+
// RUST_BACKTRACE environment variable being set.
164+
let backtrace = std::backtrace::Backtrace::force_capture();
163165
writeln!(writer, "stack backtrace: \n{backtrace:?}")
164166
}
165167
}

0 commit comments

Comments
 (0)