Stablize arc_unwrap_or_clone · rust-lang/rust@540921e (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1748,7 +1748,6 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> { | ||
1748 | 1748 | /// # Examples |
1749 | 1749 | /// |
1750 | 1750 | /// ``` |
1751 | - /// #![feature(arc_unwrap_or_clone)] | |
1752 | 1751 | /// # use std::{ptr, rc::Rc}; |
1753 | 1752 | /// let inner = String::from("test"); |
1754 | 1753 | /// let ptr = inner.as_ptr(); |
@@ -1769,7 +1768,7 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> { | ||
1769 | 1768 | /// assert!(ptr::eq(ptr, inner.as_ptr())); |
1770 | 1769 | /// ``` |
1771 | 1770 | #[inline] |
1772 | -#[unstable(feature = "arc_unwrap_or_clone", issue = "93610")] | |
1771 | +#[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")] | |
1773 | 1772 | pub fn unwrap_or_clone(this: Self) -> T { |
1774 | 1773 | Rc::try_unwrap(this).unwrap_or_else(|rc |
1775 | 1774 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2174,7 +2174,6 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> { | ||
2174 | 2174 | /// # Examples |
2175 | 2175 | /// |
2176 | 2176 | /// ``` |
2177 | - /// #![feature(arc_unwrap_or_clone)] | |
2178 | 2177 | /// # use std::{ptr, sync::Arc}; |
2179 | 2178 | /// let inner = String::from("test"); |
2180 | 2179 | /// let ptr = inner.as_ptr(); |
@@ -2195,7 +2194,7 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> { | ||
2195 | 2194 | /// assert!(ptr::eq(ptr, inner.as_ptr())); |
2196 | 2195 | /// ``` |
2197 | 2196 | #[inline] |
2198 | -#[unstable(feature = "arc_unwrap_or_clone", issue = "93610")] | |
2197 | +#[stable(feature = "arc_unwrap_or_clone", since = "CURRENT_RUSTC_VERSION")] | |
2199 | 2198 | pub fn unwrap_or_clone(this: Self) -> T { |
2200 | 2199 | Arc::try_unwrap(this).unwrap_or_else(|arc |
2201 | 2200 | } |