Add UnwindSafe to Once

This commit is contained in:
Milo 2021-11-05 18:27:54 +00:00
parent 4961b107f2
commit 8ad6e5fb67
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -90,6 +90,7 @@ mod tests;
use crate::cell::Cell;
use crate::fmt;
use crate::marker;
use crate::panic::UnwindSafe;
use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use crate::thread::{self, Thread};
@ -123,6 +124,9 @@ unsafe impl Sync for Once {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl Send for Once {}
#[stable(feature = "sync_once_ref_unwind_safe", since = "1.59.0")]
impl UnwindSafe for Once {}
/// State yielded to [`Once::call_once_force()`]s closure parameter. The state
/// can be used to query the poison status of the [`Once`].
#[stable(feature = "once_poison", since = "1.51.0")]