From 8e0b7f988ee4e12d79c03ed53b3b59fee534330e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 28 Dec 2020 00:39:09 +0100 Subject: de-stabilize unsized raw ptr methods for Weak --- library/alloc/src/sync.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'library/alloc/src/sync.rs') diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 9d478a302e9..53ba9c283ae 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1535,7 +1535,7 @@ struct WeakInner<'a> { strong: &'a atomic::AtomicUsize, } -impl Weak { +impl Weak { /// Returns a raw pointer to the object `T` pointed to by this `Weak`. /// /// The pointer is valid only if there are some strong references. The pointer may be dangling, @@ -1668,7 +1668,9 @@ impl Weak { // SAFETY: we now have recovered the original Weak pointer, so can create the Weak. unsafe { Weak { ptr: NonNull::new_unchecked(ptr) } } } +} +impl Weak { /// Attempts to upgrade the `Weak` pointer to an [`Arc`], delaying /// dropping of the inner value if successful. /// -- cgit 1.4.1-3-g733a5