From 91ee3d1c31e5d1684e0d2ec5036dc69993b6f992 Mon Sep 17 00:00:00 2001 From: Bryan Donlan Date: Thu, 24 Oct 2019 20:09:35 +0000 Subject: Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}` Closes: #57977 --- src/liballoc/rc.rs | 4 ++-- src/liballoc/sync.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index a11f9e8c145..12f86bf880f 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1803,7 +1803,7 @@ impl Weak { /// If `self` was created using [`Weak::new`], this will return 0. /// /// [`Weak::new`]: #method.new - #[unstable(feature = "weak_counts", issue = "57977")] + #[stable(feature = "weak_counts", since = "1.40.0")] pub fn strong_count(&self) -> usize { if let Some(inner) = self.inner() { inner.strong() @@ -1819,7 +1819,7 @@ impl Weak { /// allocation. /// /// [`Weak::new`]: #method.new - #[unstable(feature = "weak_counts", issue = "57977")] + #[stable(feature = "weak_counts", since = "1.40.0")] pub fn weak_count(&self) -> Option { self.inner().map(|inner| { if inner.strong() > 0 { diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 4b10f089c29..3f86dfb469e 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -1496,7 +1496,7 @@ impl Weak { /// If `self` was created using [`Weak::new`], this will return 0. /// /// [`Weak::new`]: #method.new - #[unstable(feature = "weak_counts", issue = "57977")] + #[stable(feature = "weak_counts", since = "1.40.0")] pub fn strong_count(&self) -> usize { if let Some(inner) = self.inner() { inner.strong.load(SeqCst) @@ -1519,7 +1519,7 @@ impl Weak { /// `Weak`s pointing to the same allocation. /// /// [`Weak::new`]: #method.new - #[unstable(feature = "weak_counts", issue = "57977")] + #[stable(feature = "weak_counts", since = "1.40.0")] pub fn weak_count(&self) -> Option { // Due to the implicit weak pointer added when any strong pointers are // around, we cannot implement `weak_count` correctly since it -- cgit 1.4.1-3-g733a5