diff options
| author | bors <bors@rust-lang.org> | 2023-12-10 05:01:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-10 05:01:00 +0000 |
| commit | 61afc9c92896a43fce92bd5e3bba6274c5e3e960 (patch) | |
| tree | 6bf0e4e8ee01dee37f53bc3ada04950a57c3beb4 | |
| parent | c71c246876dda4b315a2011912a724d3ad392f2d (diff) | |
| parent | 540921e468d770c47f460f1d0aeabbc8dae12ae9 (diff) | |
| download | rust-61afc9c92896a43fce92bd5e3bba6274c5e3e960.tar.gz rust-61afc9c92896a43fce92bd5e3bba6274c5e3e960.zip | |
Auto merge of #116949 - hamza1311:stablize-arc_unwrap_or_clone, r=dtolnay
Stablize arc_unwrap_or_clone Fixes: #93610 This likely needs FCP. I created this PR as it's stabilization is trivial and FCP can be just conducted here. Not sure how to ping the libs API team (last attempt didn't work apparently according to GH UI)
| -rw-r--r-- | library/alloc/src/rc.rs | 3 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 98983e670d0..62179756850 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1748,7 +1748,6 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> { /// # Examples /// /// ``` - /// #![feature(arc_unwrap_or_clone)] /// # use std::{ptr, rc::Rc}; /// let inner = String::from("test"); /// let ptr = inner.as_ptr(); @@ -1769,7 +1768,7 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> { /// assert!(ptr::eq(ptr, inner.as_ptr())); /// ``` #[inline] - #[unstable(feature = "arc_unwrap_or_clone", issue = "93610")] + #[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")] pub fn unwrap_or_clone(this: Self) -> T { Rc::try_unwrap(this).unwrap_or_else(|rc| (*rc).clone()) } diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 5a4a94d79d8..e2e836bb975 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2174,7 +2174,6 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> { /// # Examples /// /// ``` - /// #![feature(arc_unwrap_or_clone)] /// # use std::{ptr, sync::Arc}; /// let inner = String::from("test"); /// let ptr = inner.as_ptr(); @@ -2195,7 +2194,7 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> { /// assert!(ptr::eq(ptr, inner.as_ptr())); /// ``` #[inline] - #[unstable(feature = "arc_unwrap_or_clone", issue = "93610")] + #[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")] pub fn unwrap_or_clone(this: Self) -> T { Arc::try_unwrap(this).unwrap_or_else(|arc| (*arc).clone()) } |
