diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index d8cadf09cb2..ba18d15f5c4 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -227,6 +227,11 @@ impl !RefUnwindSafe for UnsafeCell {} #[stable(feature = "catch_unwind", since = "1.9.0")] impl RefUnwindSafe for AssertUnwindSafe {} +#[stable(feature = "unwind_safe_lock_refs", since = "1.12.0")] +impl RefUnwindSafe for Mutex {} +#[stable(feature = "unwind_safe_lock_refs", since = "1.12.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 b918f79f2d5..493a00ac5d0 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::>();