Skip to content

Commit 347e1af

Browse files
committed
std: Relax UnwindSafe impl for Unique
Add the `?Sized` bound as we don't require the type to be sized. Closes #40011
1 parent 3954c70 commit 347e1af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/libstd/panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *const T {}
198198
#[stable(feature = "catch_unwind", since = "1.9.0")]
199199
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {}
200200
#[unstable(feature = "unique", issue = "27730")]
201-
impl<T: UnwindSafe> UnwindSafe for Unique<T> {}
201+
impl<T: UnwindSafe + ?Sized> UnwindSafe for Unique<T> {}
202202
#[unstable(feature = "shared", issue = "27730")]
203203
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {}
204204
#[stable(feature = "catch_unwind", since = "1.9.0")]

src/test/run-pass/panic-safe.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![allow(dead_code)]
12-
#![feature(recover)]
1312

1413
use std::panic::{UnwindSafe, AssertUnwindSafe};
1514
use std::cell::RefCell;
@@ -40,6 +39,10 @@ fn main() {
4039
assert::<&RwLock<i32>>();
4140
assert::<Rc<i32>>();
4241
assert::<Arc<i32>>();
42+
assert::<Box<[u8]>>();
43+
44+
trait Trait: UnwindSafe {}
45+
assert::<Box<Trait>>();
4346

4447
fn bar<T>() {
4548
assert::<Mutex<T>>();

0 commit comments

Comments
 (0)