Skip to content

Commit 9f25a04

Browse files
committed
SeqCst->Relaxed for FIRST_PANIC.
Relaxed is enough to make sure this `swap` results in `true` only once.
1 parent 904fef0 commit 9f25a04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn default_hook(info: &PanicInfo<'_>) {
272272
drop(backtrace::print(err, crate::backtrace_rs::PrintFmt::Full))
273273
}
274274
Some(BacktraceStyle::Off) => {
275-
if FIRST_PANIC.swap(false, Ordering::SeqCst) {
275+
if FIRST_PANIC.swap(false, Ordering::Relaxed) {
276276
let _ = writeln!(
277277
err,
278278
"note: run with `RUST_BACKTRACE=1` environment variable to display a \

0 commit comments

Comments
 (0)