Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy

The logic here is the same as for Send&Sync impls.
This commit is contained in:
Aleksey Kladov 2020-07-27 11:22:36 +02:00
parent 1454bbd4fd
commit ed1439cea4
1 changed files with 3 additions and 1 deletions

View File

@ -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