Clarifiy weak pointers being diassociated…

…noting the fact that `clone` is not called.

Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
This commit is contained in:
Frank Steffahn 2021-08-24 21:15:26 +02:00 committed by Frank Steffahn
parent 51d598ec28
commit 335bf7ca6b
2 changed files with 6 additions and 4 deletions

View file

@ -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.
///

View file

@ -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.
///