File tree 2 files changed +2
-0
lines changed
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] {
147
147
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
148
148
#[ stable( feature = "array_from_ref" , since = "1.53.0" ) ]
149
149
#[ rustc_const_stable( feature = "const_array_from_ref" , since = "CURRENT_RUSTC_VERSION" ) ]
150
+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
150
151
pub const fn from_mut < T > ( s : & mut T ) -> & mut [ T ; 1 ] {
151
152
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
152
153
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] {
204
204
/// Converts a reference to T into a slice of length 1 (without copying).
205
205
#[ stable( feature = "from_ref" , since = "1.28.0" ) ]
206
206
#[ rustc_const_stable( feature = "const_slice_from_ref" , since = "CURRENT_RUSTC_VERSION" ) ]
207
+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
207
208
#[ must_use]
208
209
pub const fn from_mut < T > ( s : & mut T ) -> & mut [ T ] {
209
210
array:: from_mut ( s)
You can’t perform that action at this time.
0 commit comments