Skip to content

Commit 96ecaa1

Browse files
committed
Relocate Arc and Rc UnwindSafe impls
1 parent 60fa568 commit 96ecaa1

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ mod boxed {
177177
pub mod borrow;
178178
pub mod collections;
179179
pub mod fmt;
180-
mod panic;
181180
pub mod prelude;
182181
pub mod raw_vec;
183182
pub mod rc;

library/alloc/src/panic.rs

-11
This file was deleted.

library/alloc/src/rc.rs

+4
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ use core::marker::{self, PhantomData, Unpin, Unsize};
262262
use core::mem::size_of_val;
263263
use core::mem::{self, align_of_val_raw, forget};
264264
use core::ops::{CoerceUnsized, Deref, DispatchFromDyn, Receiver};
265+
use core::panic::{RefUnwindSafe, UnwindSafe};
265266
#[cfg(not(no_global_oom_handling))]
266267
use core::pin::Pin;
267268
use core::ptr::{self, NonNull};
@@ -314,6 +315,9 @@ impl<T: ?Sized> !marker::Send for Rc<T> {}
314315
#[stable(feature = "rust1", since = "1.0.0")]
315316
impl<T: ?Sized> !marker::Sync for Rc<T> {}
316317

318+
#[stable(feature = "catch_unwind", since = "1.9.0")]
319+
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Rc<T> {}
320+
317321
#[unstable(feature = "coerce_unsized", issue = "27732")]
318322
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {}
319323

library/alloc/src/sync.rs

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use core::marker::{PhantomData, Unpin, Unsize};
1919
use core::mem::size_of_val;
2020
use core::mem::{self, align_of_val_raw};
2121
use core::ops::{CoerceUnsized, Deref, DispatchFromDyn, Receiver};
22+
use core::panic::{RefUnwindSafe, UnwindSafe};
2223
use core::pin::Pin;
2324
use core::ptr::{self, NonNull};
2425
#[cfg(not(no_global_oom_handling))]
@@ -240,6 +241,9 @@ unsafe impl<T: ?Sized + Sync + Send> Send for Arc<T> {}
240241
#[stable(feature = "rust1", since = "1.0.0")]
241242
unsafe impl<T: ?Sized + Sync + Send> Sync for Arc<T> {}
242243

244+
#[stable(feature = "catch_unwind", since = "1.9.0")]
245+
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Arc<T> {}
246+
243247
#[unstable(feature = "coerce_unsized", issue = "27732")]
244248
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
245249

0 commit comments

Comments
 (0)