@@ -514,7 +514,8 @@ impl<T> Cell<T> {
514514 /// assert_eq!(five, 5);
515515 /// ```
516516 #[ stable( feature = "move_cell" , since = "1.17.0" ) ]
517- #[ rustc_const_unstable( feature = "const_cell_into_inner" , issue = "78729" ) ]
517+ #[ rustc_const_stable( feature = "const_cell_into_inner" , since = "CURRENT_RUSTC_VERSION" ) ]
518+ #[ rustc_allow_const_fn_unstable( const_precise_live_drops) ]
518519 pub const fn into_inner ( self ) -> T {
519520 self . value . into_inner ( )
520521 }
@@ -857,7 +858,8 @@ impl<T> RefCell<T> {
857858 /// let five = c.into_inner();
858859 /// ```
859860 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
860- #[ rustc_const_unstable( feature = "const_cell_into_inner" , issue = "78729" ) ]
861+ #[ rustc_const_stable( feature = "const_cell_into_inner" , since = "CURRENT_RUSTC_VERSION" ) ]
862+ #[ rustc_allow_const_fn_unstable( const_precise_live_drops) ]
861863 #[ inline]
862864 pub const fn into_inner ( self ) -> T {
863865 // Since this function takes `self` (the `RefCell`) by value, the
@@ -2098,8 +2100,8 @@ impl<T> UnsafeCell<T> {
20982100 /// ```
20992101 #[ inline( always) ]
21002102 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2101- // When this is const stabilized, please remove `primitive_into_inner` below.
2102- #[ rustc_const_unstable ( feature = "const_cell_into_inner" , issue = "78729" ) ]
2103+ # [ rustc_const_stable ( feature = "const_cell_into_inner" , since = "CURRENT_RUSTC_VERSION" ) ]
2104+ #[ rustc_allow_const_fn_unstable ( const_precise_live_drops ) ]
21032105 pub const fn into_inner ( self ) -> T {
21042106 self . value
21052107 }
@@ -2245,47 +2247,6 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<UnsafeCell<U>> for UnsafeCell<T> {}
22452247#[ unstable( feature = "dispatch_from_dyn" , issue = "none" ) ]
22462248impl < T : DispatchFromDyn < U > , U > DispatchFromDyn < UnsafeCell < U > > for UnsafeCell < T > { }
22472249
2248- // Special cases of UnsafeCell::into_inner where T is a primitive. These are
2249- // used by Atomic*::into_inner.
2250- //
2251- // The real UnsafeCell::into_inner cannot be used yet in a stable const function.
2252- // That is blocked on a "precise drop analysis" unstable const feature.
2253- // https://github.com/rust-lang/rust/issues/73255
2254- macro_rules! unsafe_cell_primitive_into_inner {
2255- ( $( $primitive: ident $atomic: literal) * ) => {
2256- $(
2257- #[ cfg( target_has_atomic_load_store = $atomic) ]
2258- impl UnsafeCell <$primitive> {
2259- pub ( crate ) const fn primitive_into_inner( self ) -> $primitive {
2260- self . value
2261- }
2262- }
2263- ) *
2264- } ;
2265- }
2266-
2267- unsafe_cell_primitive_into_inner ! {
2268- i8 "8"
2269- u8 "8"
2270- i16 "16"
2271- u16 "16"
2272- i32 "32"
2273- u32 "32"
2274- i64 "64"
2275- u64 "64"
2276- i128 "128"
2277- u128 "128"
2278- isize "ptr"
2279- usize "ptr"
2280- }
2281-
2282- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2283- impl < T > UnsafeCell < * mut T > {
2284- pub ( crate ) const fn primitive_into_inner ( self ) -> * mut T {
2285- self . value
2286- }
2287- }
2288-
22892250/// [`UnsafeCell`], but [`Sync`].
22902251///
22912252/// This is just an `UnsafeCell`, except it implements `Sync`
0 commit comments