From 89f120840684c56bdc4919767175e5831d80c42c Mon Sep 17 00:00:00 2001 From: malezjaa Date: Mon, 28 Sep 2026 21:23:45 +0200 Subject: [PATCH] stabilize {Arc,Rc}::is_unique --- library/alloc/src/rcs/arc.rs | 6 +----- library/alloc/src/rcs/rc.rs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/library/alloc/src/rcs/arc.rs b/library/alloc/src/rcs/arc.rs index e61ea5193eccb..981e8fd1a0251 100644 --- a/library/alloc/src/rcs/arc.rs +++ b/library/alloc/src/rcs/arc.rs @@ -2870,8 +2870,6 @@ impl Arc { /// # Examples /// /// ``` - /// #![feature(arc_is_unique)] - /// /// use std::sync::Arc; /// /// let x = Arc::new(3); @@ -2894,8 +2892,6 @@ impl Arc { /// following code is valid, even though it would be UB if it used `Arc::get_mut`: /// /// ``` - /// #![feature(arc_is_unique)] - /// /// use std::sync::Arc; /// /// let arc = Arc::new(5); @@ -2915,7 +2911,7 @@ impl Arc { /// /// [`get_mut_unchecked`]: Self::get_mut_unchecked #[inline] - #[unstable(feature = "arc_is_unique", issue = "138938")] + #[stable(feature = "arc_is_unique", since = "CURRENT_RUSTC_VERSION")] pub fn is_unique(this: &Self) -> bool { // lock the weak pointer count if we appear to be the sole weak pointer // holder. diff --git a/library/alloc/src/rcs/rc.rs b/library/alloc/src/rcs/rc.rs index 04e08c47fb587..a5bb5c13ecb5a 100644 --- a/library/alloc/src/rcs/rc.rs +++ b/library/alloc/src/rcs/rc.rs @@ -1996,8 +1996,6 @@ impl Rc { /// # Examples /// /// ``` - /// #![feature(arc_is_unique)] - /// /// use std::rc::Rc; /// /// let x = Rc::new(3); @@ -2020,8 +2018,6 @@ impl Rc { /// following code is valid, even though it would be UB if it used `Rc::get_mut`: /// /// ``` - /// #![feature(arc_is_unique)] - /// /// use std::rc::Rc; /// /// let rc = Rc::new(5); @@ -2032,7 +2028,7 @@ impl Rc { /// /// [`get_mut_unchecked`]: Self::get_mut_unchecked #[inline] - #[unstable(feature = "arc_is_unique", issue = "138938")] + #[stable(feature = "arc_is_unique", since = "CURRENT_RUSTC_VERSION")] pub fn is_unique(this: &Self) -> bool { Rc::weak_count(this) == 0 && Rc::strong_count(this) == 1 }