std: Relax UnwindSafe impl for Unique
Add the `?Sized` bound as we don't require the type to be sized. Closes #40011
This commit is contained in:
parent
3954c70537
commit
347e1af66b
2 changed files with 5 additions and 2 deletions
|
@ -198,7 +198,7 @@ impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *const T {}
|
||||||
#[stable(feature = "catch_unwind", since = "1.9.0")]
|
#[stable(feature = "catch_unwind", since = "1.9.0")]
|
||||||
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {}
|
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {}
|
||||||
#[unstable(feature = "unique", issue = "27730")]
|
#[unstable(feature = "unique", issue = "27730")]
|
||||||
impl<T: UnwindSafe> UnwindSafe for Unique<T> {}
|
impl<T: UnwindSafe + ?Sized> UnwindSafe for Unique<T> {}
|
||||||
#[unstable(feature = "shared", issue = "27730")]
|
#[unstable(feature = "shared", issue = "27730")]
|
||||||
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {}
|
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {}
|
||||||
#[stable(feature = "catch_unwind", since = "1.9.0")]
|
#[stable(feature = "catch_unwind", since = "1.9.0")]
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![feature(recover)]
|
|
||||||
|
|
||||||
use std::panic::{UnwindSafe, AssertUnwindSafe};
|
use std::panic::{UnwindSafe, AssertUnwindSafe};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -40,6 +39,10 @@ fn main() {
|
||||||
assert::<&RwLock<i32>>();
|
assert::<&RwLock<i32>>();
|
||||||
assert::<Rc<i32>>();
|
assert::<Rc<i32>>();
|
||||||
assert::<Arc<i32>>();
|
assert::<Arc<i32>>();
|
||||||
|
assert::<Box<[u8]>>();
|
||||||
|
|
||||||
|
trait Trait: UnwindSafe {}
|
||||||
|
assert::<Box<Trait>>();
|
||||||
|
|
||||||
fn bar<T>() {
|
fn bar<T>() {
|
||||||
assert::<Mutex<T>>();
|
assert::<Mutex<T>>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue