Skip to content

Commit 8ad6e5f

Browse files
committed
Add UnwindSafe to Once
1 parent 4961b10 commit 8ad6e5f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: library/std/src/sync/once.rs

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ mod tests;
9090
use crate::cell::Cell;
9191
use crate::fmt;
9292
use crate::marker;
93+
use crate::panic::UnwindSafe;
9394
use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
9495
use crate::thread::{self, Thread};
9596

@@ -123,6 +124,9 @@ unsafe impl Sync for Once {}
123124
#[stable(feature = "rust1", since = "1.0.0")]
124125
unsafe impl Send for Once {}
125126

127+
#[stable(feature = "sync_once_ref_unwind_safe", since = "1.59.0")]
128+
impl UnwindSafe for Once {}
129+
126130
/// State yielded to [`Once::call_once_force()`]’s closure parameter. The state
127131
/// can be used to query the poison status of the [`Once`].
128132
#[stable(feature = "once_poison", since = "1.51.0")]

0 commit comments

Comments
 (0)