Mutex and RwLock need RefUnwindSafe too.

This commit is contained in:
Aaron Gallagher 2016-07-08 22:48:04 -07:00
parent d40c593f42
commit c11540587f
2 changed files with 8 additions and 0 deletions

View file

@ -227,6 +227,12 @@ impl<T: ?Sized> !RefUnwindSafe for UnsafeCell<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T> RefUnwindSafe for AssertUnwindSafe<T> {}
// XXX: Obviously wrong, but what should it be?
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: ?Sized> RefUnwindSafe for Mutex<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: ?Sized> RefUnwindSafe for RwLock<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T> Deref for AssertUnwindSafe<T> {
type Target = T;

View file

@ -36,6 +36,8 @@ fn main() {
assert::<Box<i32>>();
assert::<Mutex<i32>>();
assert::<RwLock<i32>>();
assert::<&Mutex<i32>>();
assert::<&RwLock<i32>>();
assert::<Rc<i32>>();
assert::<Arc<i32>>();