Rollup merge of #90625 - Milo123459:ref-unwind-safe, r=dtolnay
Add `UnwindSafe` to `Once` Fixes #43469
This commit is contained in:
commit
40c6720620
1 changed files with 7 additions and 0 deletions
|
@ -90,6 +90,7 @@ mod tests;
|
||||||
use crate::cell::Cell;
|
use crate::cell::Cell;
|
||||||
use crate::fmt;
|
use crate::fmt;
|
||||||
use crate::marker;
|
use crate::marker;
|
||||||
|
use crate::panic::{RefUnwindSafe, UnwindSafe};
|
||||||
use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||||
use crate::thread::{self, Thread};
|
use crate::thread::{self, Thread};
|
||||||
|
|
||||||
|
@ -123,6 +124,12 @@ unsafe impl Sync for Once {}
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
unsafe impl Send for Once {}
|
unsafe impl Send for Once {}
|
||||||
|
|
||||||
|
#[stable(feature = "sync_once_unwind_safe", since = "1.59.0")]
|
||||||
|
impl UnwindSafe for Once {}
|
||||||
|
|
||||||
|
#[stable(feature = "sync_once_unwind_safe", since = "1.59.0")]
|
||||||
|
impl RefUnwindSafe for Once {}
|
||||||
|
|
||||||
/// State yielded to [`Once::call_once_force()`]’s closure parameter. The state
|
/// State yielded to [`Once::call_once_force()`]’s closure parameter. The state
|
||||||
/// can be used to query the poison status of the [`Once`].
|
/// can be used to query the poison status of the [`Once`].
|
||||||
#[stable(feature = "once_poison", since = "1.51.0")]
|
#[stable(feature = "once_poison", since = "1.51.0")]
|
||||||
|
|
Loading…
Reference in a new issue