File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
147147/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
148148#[ stable( feature = "array_from_ref" , since = "1.53.0" ) ]
149149#[ rustc_const_stable( feature = "const_array_from_ref" , since = "CURRENT_RUSTC_VERSION" ) ]
150+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
150151pub const fn from_mut < T > ( s : & mut T ) -> & mut [ T ; 1 ] {
151152 // SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
152153 unsafe { & mut * ( s as * mut T ) . cast :: < [ T ; 1 ] > ( ) }
Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ pub const fn from_ref<T>(s: &T) -> &[T] {
204204/// Converts a reference to T into a slice of length 1 (without copying).
205205#[ stable( feature = "from_ref" , since = "1.28.0" ) ]
206206#[ rustc_const_stable( feature = "const_slice_from_ref" , since = "CURRENT_RUSTC_VERSION" ) ]
207+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
207208#[ must_use]
208209pub const fn from_mut < T > ( s : & mut T ) -> & mut [ T ] {
209210 array:: from_mut ( s)
You can’t perform that action at this time.
0 commit comments