about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-10 20:29:07 +0200
committerGitHub <noreply@github.com>2025-09-10 20:29:07 +0200
commitd061896a377bbc80837d99f8d71707e409e20d25 (patch)
treee29b45c86eb73113d0f4c3e3973c727bfe2df21a /library/std/src
parent4a834b54d4657700df46293eca7187ae5c22cc2b (diff)
parentef7b036458552bb5a2ab1cdef8e39a17d9f68839 (diff)
downloadrust-d061896a377bbc80837d99f8d71707e409e20d25.tar.gz
rust-d061896a377bbc80837d99f8d71707e409e20d25.zip
Rollup merge of #146322 - weiznich:fix/146087, r=joboet
Make Barrier RefUnwindSafe again

This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fix rust-lang/rust#146087. This is a fix for a regression indroduced by https://github.com/rust-lang/rust/commit/e95db591a4550e28ad92660b753ad85b89271882
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sync/barrier.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs
index 712ce03f90b..8988126bd90 100644
--- a/library/std/src/sync/barrier.rs
+++ b/library/std/src/sync/barrier.rs
@@ -1,4 +1,5 @@
 use crate::fmt;
+use crate::panic::RefUnwindSafe;
 use crate::sync::nonpoison::{Condvar, Mutex};
 
 /// A barrier enables multiple threads to synchronize the beginning
@@ -31,6 +32,9 @@ pub struct Barrier {
     num_threads: usize,
 }
 
+#[stable(feature = "unwind_safe_lock_refs", since = "1.12.0")]
+impl RefUnwindSafe for Barrier {}
+
 // The inner state of a double barrier
 struct BarrierState {
     count: usize,