From 20d02258fc24c5ab7572cfa5064a733021e6fbcd Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Mon, 8 Sep 2025 08:17:06 +0200 Subject: Make Barrier RefUnwindSafe again This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fix 146087. This is a fix for a regression indroduced by https://github.com/rust-lang/rust/commit/e95db591a4550e28ad92660b753ad85b89271882 --- library/std/src/sync/barrier.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'library/std/src') diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs index 712ce03f90b..47d63c57ff1 100644 --- a/library/std/src/sync/barrier.rs +++ b/library/std/src/sync/barrier.rs @@ -1,3 +1,5 @@ +use core::panic::RefUnwindSafe; + use crate::fmt; use crate::sync::nonpoison::{Condvar, Mutex}; @@ -31,6 +33,9 @@ pub struct Barrier { num_threads: usize, } +#[stable(feature = "rust1", since = "1.0.0")] +impl RefUnwindSafe for Barrier {} + // The inner state of a double barrier struct BarrierState { count: usize, -- cgit 1.4.1-3-g733a5