From c11540587f45826c76f33b7fbbb9a919a5af8ebd Mon Sep 17 00:00:00 2001 From: Aaron Gallagher <_@habnab.it> Date: Fri, 8 Jul 2016 22:48:04 -0700 Subject: [PATCH] Mutex and RwLock need RefUnwindSafe too. --- src/libstd/panic.rs | 6 ++++++ src/test/run-pass/panic-safe.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index d8cadf09cb2a..d5699fca85db 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -227,6 +227,12 @@ impl !RefUnwindSafe for UnsafeCell {} #[stable(feature = "catch_unwind", since = "1.9.0")] impl RefUnwindSafe for AssertUnwindSafe {} +// XXX: Obviously wrong, but what should it be? +#[stable(feature = "catch_unwind", since = "1.9.0")] +impl RefUnwindSafe for Mutex {} +#[stable(feature = "catch_unwind", since = "1.9.0")] +impl RefUnwindSafe for RwLock {} + #[stable(feature = "catch_unwind", since = "1.9.0")] impl Deref for AssertUnwindSafe { type Target = T; diff --git a/src/test/run-pass/panic-safe.rs b/src/test/run-pass/panic-safe.rs index b918f79f2d5d..493a00ac5d00 100644 --- a/src/test/run-pass/panic-safe.rs +++ b/src/test/run-pass/panic-safe.rs @@ -36,6 +36,8 @@ fn main() { assert::>(); assert::>(); assert::>(); + assert::<&Mutex>(); + assert::<&RwLock>(); assert::>(); assert::>();