Skip to content

Commit 91161ed

Browse files
committed
impl RefUnwindSafe for Once
1 parent 8ad6e5f commit 91161ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ mod tests;
9090
use crate::cell::Cell;
9191
use crate::fmt;
9292
use crate::marker;
93-
use crate::panic::UnwindSafe;
93+
use crate::panic::{RefUnwindSafe, UnwindSafe};
9494
use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
9595
use crate::thread::{self, Thread};
9696

@@ -124,9 +124,12 @@ unsafe impl Sync for Once {}
124124
#[stable(feature = "rust1", since = "1.0.0")]
125125
unsafe impl Send for Once {}
126126

127-
#[stable(feature = "sync_once_ref_unwind_safe", since = "1.59.0")]
127+
#[stable(feature = "sync_once_unwind_safe", since = "1.59.0")]
128128
impl UnwindSafe for Once {}
129129

130+
#[stable(feature = "sync_once_unwind_safe", since = "1.59.0")]
131+
impl RefUnwindSafe for Once {}
132+
130133
/// State yielded to [`Once::call_once_force()`]’s closure parameter. The state
131134
/// can be used to query the poison status of the [`Once`].
132135
#[stable(feature = "once_poison", since = "1.51.0")]

0 commit comments

Comments
 (0)