Skip to content

Commit

Permalink
Use Backtrace::force_capture instead of Backtrace::capture in rustc_log
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed May 21, 2024
1 parent 1d0e4af commit 8f11f48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ where
if !target.contains(&self.backtrace_target) {
return Ok(());
}
let backtrace = std::backtrace::Backtrace::capture();
// Use Backtrace::force_capture because we don't want to depend on the
// RUST_BACKTRACE environment variable being set.
let backtrace = std::backtrace::Backtrace::force_capture();
writeln!(writer, "stack backtrace: \n{backtrace:?}")
}
}
Expand Down

0 comments on commit 8f11f48

Please sign in to comment.