Skip to content

Commit

Permalink
Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy
Browse files Browse the repository at this point in the history
The logic here is the same as for Send&Sync impls.
  • Loading branch information
matklad committed Jul 28, 2020
1 parent 1454bbd commit ed1439c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/std/src/lazy.rs
Expand Up @@ -451,7 +451,9 @@ unsafe impl<T, F: Send> Sync for SyncLazy<T, F> where SyncOnceCell<T>: Sync {}
// auto-derived `Send` impl is OK.

#[unstable(feature = "once_cell", issue = "74465")]
impl<T, F: RefUnwindSafe> RefUnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: RefUnwindSafe {}
impl<T, F: UnwindSafe> RefUnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: RefUnwindSafe {}
#[unstable(feature = "once_cell", issue = "74465")]
impl<T, F: UnwindSafe> UnwindSafe for SyncLazy<T, F> where SyncOnceCell<T>: UnwindSafe {}

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

0 comments on commit ed1439c

Please sign in to comment.