Skip to content

Commit 7a641f7

Browse files
committed
Relax the safety condition for get_mut_unchecked
1 parent 810dfd7 commit 7a641f7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/liballoc/rc.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,10 @@ impl<T: ?Sized> Rc<T> {
719719
///
720720
/// # Safety
721721
///
722-
/// There must be no other `Rc` or [`Weak`] pointers to the same value.
723-
/// This is the case for example immediately after `Rc::new`.
722+
/// Any other `Rc` or [`Weak`] pointers to the same value must not be dereferenced
723+
/// for the duration of the returned borrow.
724+
/// This is trivially the case if no such pointer exist,
725+
/// for example immediately after `Rc::new`.
724726
///
725727
/// # Examples
726728
///

src/liballoc/sync.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,10 @@ impl<T: ?Sized> Arc<T> {
11041104
///
11051105
/// # Safety
11061106
///
1107-
/// There must be no other `Arc` or [`Weak`] pointers to the same value.
1108-
/// This is the case for example immediately after `Rc::new`.
1107+
/// Any other `Arc` or [`Weak`] pointers to the same value must not be dereferenced
1108+
/// for the duration of the returned borrow.
1109+
/// This is trivially the case if no such pointer exist,
1110+
/// for example immediately after `Arc::new`.
11091111
///
11101112
/// # Examples
11111113
///

0 commit comments

Comments
 (0)