From 347e1af66b4b705594c3f668460f252af4e87146 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Feb 2017 14:36:03 -0800 Subject: [PATCH] std: Relax UnwindSafe impl for Unique Add the `?Sized` bound as we don't require the type to be sized. Closes #40011 --- src/libstd/panic.rs | 2 +- src/test/run-pass/panic-safe.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index ac0d0d2afb803..f99634ecac23f 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -198,7 +198,7 @@ impl UnwindSafe for *const T {} #[stable(feature = "catch_unwind", since = "1.9.0")] impl UnwindSafe for *mut T {} #[unstable(feature = "unique", issue = "27730")] -impl UnwindSafe for Unique {} +impl UnwindSafe for Unique {} #[unstable(feature = "shared", issue = "27730")] impl UnwindSafe for Shared {} #[stable(feature = "catch_unwind", since = "1.9.0")] diff --git a/src/test/run-pass/panic-safe.rs b/src/test/run-pass/panic-safe.rs index 493a00ac5d00d..9bda07f077f06 100644 --- a/src/test/run-pass/panic-safe.rs +++ b/src/test/run-pass/panic-safe.rs @@ -9,7 +9,6 @@ // except according to those terms. #![allow(dead_code)] -#![feature(recover)] use std::panic::{UnwindSafe, AssertUnwindSafe}; use std::cell::RefCell; @@ -40,6 +39,10 @@ fn main() { assert::<&RwLock>(); assert::>(); assert::>(); + assert::>(); + + trait Trait: UnwindSafe {} + assert::>(); fn bar() { assert::>();