about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2024-03-19 14:58:40 +0100
committerMara Bos <m-ou.se@m-ou.se>2024-03-19 15:27:11 +0100
commit9f25a04498fbe30dcf6a9c764953704c333a0137 (patch)
tree324c17cf40b97e7f59338eda0eb53fb54587d700 /library/std/src
parent904fef0e24c8b7f7ff0a33c1b7f3ecbb59ade249 (diff)
downloadrust-9f25a04498fbe30dcf6a9c764953704c333a0137.tar.gz
rust-9f25a04498fbe30dcf6a9c764953704c333a0137.zip
SeqCst->Relaxed for FIRST_PANIC.
Relaxed is enough to make sure this `swap` results in `true` only once.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/panicking.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 464a46264cb..b0bcab7994c 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -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 \