Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

std: Relax UnwindSafe impl for Unique #40020

Merged
merged 1 commit into from
Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libstd/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *const T {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for *mut T {}
#[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")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Shared<T> {}
#[stable(feature = "catch_unwind", since = "1.9.0")]
Expand Down
5 changes: 4 additions & 1 deletion src/test/run-pass/panic-safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

#![allow(dead_code)]
#![feature(recover)]

use std::panic::{UnwindSafe, AssertUnwindSafe};
use std::cell::RefCell;
Expand Down Expand Up @@ -40,6 +39,10 @@ fn main() {
assert::<&RwLock<i32>>();
assert::<Rc<i32>>();
assert::<Arc<i32>>();
assert::<Box<[u8]>>();

trait Trait: UnwindSafe {}
assert::<Box<Trait>>();

fn bar<T>() {
assert::<Mutex<T>>();
Expand Down