Skip to content

Commit 8f11f48

Browse files
Use Backtrace::force_capture instead of Backtrace::capture in rustc_log
1 parent 1d0e4af commit 8f11f48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)