diff options
| -rw-r--r-- | library/alloc/src/rc.rs | 5 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 90b077210a4..272fc119f4e 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1100,8 +1100,9 @@ impl<T: Clone> Rc<T> { /// [`clone`] the inner value to a new allocation to ensure unique ownership. This is also /// referred to as clone-on-write. /// - /// If there are no other `Rc` pointers to this allocation, then [`Weak`] - /// pointers to this allocation will be disassociated. + /// However, if there are no other `Rc` pointers to this allocation, but some [`Weak`] + /// pointers, then the [`Weak`] pointers will be disassociated and the inner value will not + /// be cloned. /// /// See also [`get_mut`], which will fail rather than cloning. /// diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 7e4cb6d2c60..2367eaec4b9 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1350,8 +1350,9 @@ impl<T: Clone> Arc<T> { /// [`clone`] the inner value to a new allocation to ensure unique ownership. This is also /// referred to as clone-on-write. /// - /// If there are no other `Arc` pointers to this allocation, then [`Weak`] - /// pointers to this allocation will be disassociated. + /// However, if there are no other `Arc` pointers to this allocation, but some [`Weak`] + /// pointers, then the [`Weak`] pointers will be disassociated and the inner value will not + /// be cloned. /// /// See also [`get_mut`], which will fail rather than cloning. /// |
