File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1091,10 +1091,11 @@ impl<T: ?Sized> Rc<T> {
1091
1091
///
1092
1092
/// # Safety
1093
1093
///
1094
- /// Any other `Rc` or [`Weak`] pointers to the same allocation must not be dereferenced
1095
- /// for the duration of the returned borrow.
1096
- /// This is trivially the case if no such pointers exist,
1097
- /// for example immediately after `Rc::new`.
1094
+ /// If any other `Rc` or [`Weak`] pointers to the same allocation exist, then
1095
+ /// they must be must not be dereferenced or have active borrows for the duration
1096
+ /// of the returned borrow, and their inner type must be exactly the same as the
1097
+ /// inner type of this Rc (including lifetimes). This is trivially the case if no
1098
+ /// such pointers exist, for example immediately after `Rc::new`.
1098
1099
///
1099
1100
/// # Examples
1100
1101
///
Original file line number Diff line number Diff line change @@ -1630,10 +1630,11 @@ impl<T: ?Sized> Arc<T> {
1630
1630
///
1631
1631
/// # Safety
1632
1632
///
1633
- /// Any other `Arc` or [`Weak`] pointers to the same allocation must not be dereferenced
1634
- /// for the duration of the returned borrow.
1635
- /// This is trivially the case if no such pointers exist,
1636
- /// for example immediately after `Arc::new`.
1633
+ /// If any other `Arc` or [`Weak`] pointers to the same allocation exist, then
1634
+ /// they must be must not be dereferenced or have active borrows for the duration
1635
+ /// of the returned borrow, and their inner type must be exactly the same as the
1636
+ /// inner type of this Rc (including lifetimes). This is trivially the case if no
1637
+ /// such pointers exist, for example immediately after `Arc::new`.
1637
1638
///
1638
1639
/// # Examples
1639
1640
///
You can’t perform that action at this time.
0 commit comments