Skip to content

Commit

Permalink
SeqCst->Relaxed for FIRST_PANIC.
Browse files Browse the repository at this point in the history
Relaxed is enough to make sure this `swap` results in `true` only once.
  • Loading branch information
m-ou-se committed Mar 19, 2024
1 parent 904fef0 commit 9f25a04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn default_hook(info: &PanicInfo<'_>) {
drop(backtrace::print(err, crate::backtrace_rs::PrintFmt::Full))
}
Some(BacktraceStyle::Off) => {
if FIRST_PANIC.swap(false, Ordering::SeqCst) {
if FIRST_PANIC.swap(false, Ordering::Relaxed) {
let _ = writeln!(
err,
"note: run with `RUST_BACKTRACE=1` environment variable to display a \
Expand Down

0 comments on commit 9f25a04

Please sign in to comment.