Skip to content

Commit 540921e

Browse files
committed
Stablize arc_unwrap_or_clone
1 parent c104861 commit 540921e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/alloc/src/rc.rs

+1-2
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
}

library/alloc/src/sync.rs

+1-2
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)