File tree Expand file tree Collapse file tree 4 files changed +2
-4
lines changed Expand file tree Collapse file tree 4 files changed +2
-4
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 114114#![ feature( const_align_offset) ]
115115#![ feature( const_alloc_layout) ]
116116#![ feature( const_arguments_as_str) ]
117- #![ feature( const_array_from_ref) ]
118117#![ feature( const_array_into_iter_constructors) ]
119118#![ feature( const_bigint_helper_methods) ]
120119#![ feature( const_black_box) ]
148147#![ feature( const_size_of_val) ]
149148#![ feature( const_size_of_val_raw) ]
150149#![ feature( const_slice_from_raw_parts_mut) ]
151- #![ feature( const_slice_from_ref) ]
152150#![ feature( const_slice_split_at_mut) ]
153151#![ feature( const_str_from_utf8_unchecked_mut) ]
154152#![ feature( const_strict_overflow_ops) ]
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)
Original file line number Diff line number Diff line change 1616#![ feature( clone_to_uninit) ]
1717#![ feature( const_align_of_val_raw) ]
1818#![ feature( const_align_offset) ]
19- #![ feature( const_array_from_ref) ]
2019#![ feature( const_black_box) ]
2120#![ feature( const_cell_into_inner) ]
2221#![ feature( const_hash) ]
3534#![ feature( const_ptr_as_ref) ]
3635#![ feature( const_ptr_write) ]
3736#![ feature( const_result) ]
38- #![ feature( const_slice_from_ref) ]
3937#![ feature( const_three_way_compare) ]
4038#![ feature( const_trait_impl) ]
4139#![ feature( core_intrinsics) ]
You can’t perform that action at this time.
0 commit comments