Skip to content

Commit 4061c04

Browse files
committed
Auto merge of #87467 - inquisitivecrystal:ref-unwind, r=dtolnay
Implement `RefUnwindSafe` for `Rc<T>` This PR implements `RefUnwindSafe` for `Rc<T>`, where `T: RefUnwindSafe`. This impl was omitted by an apparent oversight. `Rc<T>` already implements `UnwindSafe`. `Arc<T>` implements both `UnwindSafe` and `RefUnwindSafe`. There is no reason why an `&Rc<T>` is any less unwind safe than a `Rc<T>` or an `&Arc<T>`, so this should be safe to add. Resolves #45924.
2 parents 0b4ac62 + bd194da commit 4061c04

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/alloc/src/rc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ impl<T: ?Sized> !marker::Sync for Rc<T> {}
318318

319319
#[stable(feature = "catch_unwind", since = "1.9.0")]
320320
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Rc<T> {}
321+
#[stable(feature = "rc_ref_unwind_safe", since = "1.58.0")]
322+
impl<T: RefUnwindSafe + ?Sized> RefUnwindSafe for Rc<T> {}
321323

322324
#[unstable(feature = "coerce_unsized", issue = "27732")]
323325
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {}

0 commit comments

Comments
 (0)