about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMilo <50248166+Milo123459@users.noreply.github.com>2021-11-05 18:27:54 +0000
committerMilo <50248166+Milo123459@users.noreply.github.com>2021-11-05 18:27:54 +0000
commit8ad6e5fb671a2343b81aee29cb344f4804bbb0f4 (patch)
tree7902b9617ccbfb16f0838e8dd90d51025aaa10bb
parent4961b107f204e15b26961eab0685df6be3ab03c6 (diff)
downloadrust-8ad6e5fb671a2343b81aee29cb344f4804bbb0f4.tar.gz
rust-8ad6e5fb671a2343b81aee29cb344f4804bbb0f4.zip
Add UnwindSafe to Once
-rw-r--r--library/std/src/sync/once.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sync/once.rs b/library/std/src/sync/once.rs
index 1710c005393..47921283b21 100644
--- a/library/std/src/sync/once.rs
+++ b/library/std/src/sync/once.rs
@@ -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")]