File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2122,7 +2122,6 @@ impl<T: ?Sized> UnsafeCell<T> {
2122
2122
/// # Examples
2123
2123
///
2124
2124
/// ```
2125
- /// # #![feature(unsafe_cell_from_mut)]
2126
2125
/// use std::cell::UnsafeCell;
2127
2126
///
2128
2127
/// let mut val = 42;
@@ -2132,7 +2131,9 @@ impl<T: ?Sized> UnsafeCell<T> {
2132
2131
/// assert_eq!(*uc.get_mut(), 41);
2133
2132
/// ```
2134
2133
#[ inline( always) ]
2135
- #[ unstable( feature = "unsafe_cell_from_mut" , issue = "111645" ) ]
2134
+ #[ stable( feature = "unsafe_cell_from_mut" , since = "CURRENT_RUSTC_VERSION" ) ]
2135
+ #[ rustc_const_stable( feature = "unsafe_cell_from_mut" , since = "CURRENT_RUSTC_VERSION" ) ]
2136
+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
2136
2137
pub const fn from_mut ( value : & mut T ) -> & mut UnsafeCell < T > {
2137
2138
// SAFETY: `UnsafeCell<T>` has the same memory layout as `T` due to #[repr(transparent)].
2138
2139
unsafe { & mut * ( value as * mut T as * mut UnsafeCell < T > ) }
You can’t perform that action at this time.
0 commit comments