Skip to content

Commit ed1439c

Browse files
committed
Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy
The logic here is the same as for Send&Sync impls.
1 parent 1454bbd commit ed1439c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/std/src/lazy.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ unsafe impl<T, F: Send> Sync for SyncLazy<T, F> where SyncOnceCell<T>: Sync {}
451451
// auto-derived `Send` impl is OK.
452452

453453
#[unstable(feature = "once_cell", issue = "74465")]
454-
impl<T, F: RefUnwindSafe> RefUnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: RefUnwindSafe {}
454+
impl<T, F: UnwindSafe> RefUnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: RefUnwindSafe {}
455+
#[unstable(feature = "once_cell", issue = "74465")]
456+
impl<T, F: UnwindSafe> UnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: UnwindSafe {}
455457

456458
impl<T, F> SyncLazy<T, F> {
457459
/// Creates a new lazy value with the given initializing

0 commit comments

Comments
 (0)