File tree 4 files changed +2
-4
lines changed
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] {
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 114
114
#![ feature( const_align_offset) ]
115
115
#![ feature( const_alloc_layout) ]
116
116
#![ feature( const_arguments_as_str) ]
117
- #![ feature( const_array_from_ref) ]
118
117
#![ feature( const_array_into_iter_constructors) ]
119
118
#![ feature( const_bigint_helper_methods) ]
120
119
#![ feature( const_black_box) ]
148
147
#![ feature( const_size_of_val) ]
149
148
#![ feature( const_size_of_val_raw) ]
150
149
#![ feature( const_slice_from_raw_parts_mut) ]
151
- #![ feature( const_slice_from_ref) ]
152
150
#![ feature( const_slice_split_at_mut) ]
153
151
#![ feature( const_str_from_utf8_unchecked_mut) ]
154
152
#![ 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] {
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)
Original file line number Diff line number Diff line change 16
16
#![ feature( clone_to_uninit) ]
17
17
#![ feature( const_align_of_val_raw) ]
18
18
#![ feature( const_align_offset) ]
19
- #![ feature( const_array_from_ref) ]
20
19
#![ feature( const_black_box) ]
21
20
#![ feature( const_cell_into_inner) ]
22
21
#![ feature( const_hash) ]
35
34
#![ feature( const_ptr_as_ref) ]
36
35
#![ feature( const_ptr_write) ]
37
36
#![ feature( const_result) ]
38
- #![ feature( const_slice_from_ref) ]
39
37
#![ feature( const_three_way_compare) ]
40
38
#![ feature( const_trait_impl) ]
41
39
#![ feature( core_intrinsics) ]
You can’t perform that action at this time.
0 commit comments