From ed1439cea48144dcdfee84ccd8d7b0d0edb9f64e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov <aleksey.kladov@gmail.com> Date: Mon, 27 Jul 2020 11:22:36 +0200 Subject: [PATCH] Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy The logic here is the same as for Send&Sync impls. --- library/std/src/lazy.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/std/src/lazy.rs b/library/std/src/lazy.rs index 1705a4f77c5..60eba96bcc0 100644 --- a/library/std/src/lazy.rs +++ b/library/std/src/lazy.rs @@ -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