Skip to content

Commit 91ee3d1

Browse files
author
Bryan Donlan
committed
Stabilize std::{rc,sync}::Weak::{weak_count, strong_count}
Closes: #57977
1 parent 35ef33a commit 91ee3d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/liballoc/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ impl<T: ?Sized> Weak<T> {
18031803
/// If `self` was created using [`Weak::new`], this will return 0.
18041804
///
18051805
/// [`Weak::new`]: #method.new
1806-
#[unstable(feature = "weak_counts", issue = "57977")]
1806+
#[stable(feature = "weak_counts", since = "1.40.0")]
18071807
pub fn strong_count(&self) -> usize {
18081808
if let Some(inner) = self.inner() {
18091809
inner.strong()
@@ -1819,7 +1819,7 @@ impl<T: ?Sized> Weak<T> {
18191819
/// allocation.
18201820
///
18211821
/// [`Weak::new`]: #method.new
1822-
#[unstable(feature = "weak_counts", issue = "57977")]
1822+
#[stable(feature = "weak_counts", since = "1.40.0")]
18231823
pub fn weak_count(&self) -> Option<usize> {
18241824
self.inner().map(|inner| {
18251825
if inner.strong() > 0 {

src/liballoc/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ impl<T: ?Sized> Weak<T> {
14961496
/// If `self` was created using [`Weak::new`], this will return 0.
14971497
///
14981498
/// [`Weak::new`]: #method.new
1499-
#[unstable(feature = "weak_counts", issue = "57977")]
1499+
#[stable(feature = "weak_counts", since = "1.40.0")]
15001500
pub fn strong_count(&self) -> usize {
15011501
if let Some(inner) = self.inner() {
15021502
inner.strong.load(SeqCst)
@@ -1519,7 +1519,7 @@ impl<T: ?Sized> Weak<T> {
15191519
/// `Weak`s pointing to the same allocation.
15201520
///
15211521
/// [`Weak::new`]: #method.new
1522-
#[unstable(feature = "weak_counts", issue = "57977")]
1522+
#[stable(feature = "weak_counts", since = "1.40.0")]
15231523
pub fn weak_count(&self) -> Option<usize> {
15241524
// Due to the implicit weak pointer added when any strong pointers are
15251525
// around, we cannot implement `weak_count` correctly since it

0 commit comments

Comments
 (0)