Skip to content

Commit e5ea697

Browse files
committed
Auto merge of rust-lang#116949 - hamza1311:stablize-arc_unwrap_or_clone, r=dtolnay
Stablize arc_unwrap_or_clone Fixes: rust-lang#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)
2 parents 0c2b701 + 5799d21 commit e5ea697

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

alloc/src/rc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,6 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> {
17481748
/// # Examples
17491749
///
17501750
/// ```
1751-
/// #![feature(arc_unwrap_or_clone)]
17521751
/// # use std::{ptr, rc::Rc};
17531752
/// let inner = String::from("test");
17541753
/// let ptr = inner.as_ptr();
@@ -1769,7 +1768,7 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> {
17691768
/// assert!(ptr::eq(ptr, inner.as_ptr()));
17701769
/// ```
17711770
#[inline]
1772-
#[unstable(feature = "arc_unwrap_or_clone", issue = "93610")]
1771+
#[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")]
17731772
pub fn unwrap_or_clone(this: Self) -> T {
17741773
Rc::try_unwrap(this).unwrap_or_else(|rc| (*rc).clone())
17751774
}

alloc/src/sync.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,6 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> {
21742174
/// # Examples
21752175
///
21762176
/// ```
2177-
/// #![feature(arc_unwrap_or_clone)]
21782177
/// # use std::{ptr, sync::Arc};
21792178
/// let inner = String::from("test");
21802179
/// let ptr = inner.as_ptr();
@@ -2195,7 +2194,7 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> {
21952194
/// assert!(ptr::eq(ptr, inner.as_ptr()));
21962195
/// ```
21972196
#[inline]
2198-
#[unstable(feature = "arc_unwrap_or_clone", issue = "93610")]
2197+
#[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")]
21992198
pub fn unwrap_or_clone(this: Self) -> T {
22002199
Arc::try_unwrap(this).unwrap_or_else(|arc| (*arc).clone())
22012200
}

0 commit comments

Comments
 (0)