File tree 4 files changed +4
-6
lines changed
4 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
146
146
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
- #[ rustc_const_unstable( feature = "const_array_from_ref" , issue = "90206" ) ]
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) ]
145
144
#![ feature( const_replace) ]
146
145
#![ feature( const_size_of_val) ]
147
146
#![ feature( const_size_of_val_raw) ]
148
- #![ feature( const_slice_from_ref) ]
149
147
#![ feature( const_strict_overflow_ops) ]
150
148
#![ feature( const_swap) ]
151
149
#![ feature( const_try) ]
Original file line number Diff line number Diff line change @@ -204,7 +204,8 @@ pub const fn from_ref<T>(s: &T) -> &[T] {
204
204
205
205
/// Converts a reference to T into a slice of length 1 (without copying).
206
206
#[ stable( feature = "from_ref" , since = "1.28.0" ) ]
207
- #[ rustc_const_unstable( feature = "const_slice_from_ref" , issue = "90206" ) ]
207
+ #[ rustc_const_stable( feature = "const_slice_from_ref" , since = "CURRENT_RUSTC_VERSION" ) ]
208
+ #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( const_mut_refs) ) ]
208
209
#[ must_use]
209
210
pub const fn from_mut < T > ( s : & mut T ) -> & mut [ T ] {
210
211
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_hash) ]
22
21
#![ feature( const_heap) ]
31
30
#![ feature( const_pointer_is_aligned) ]
32
31
#![ feature( const_ptr_write) ]
33
32
#![ feature( const_result) ]
34
- #![ feature( const_slice_from_ref) ]
35
33
#![ feature( const_three_way_compare) ]
36
34
#![ feature( const_trait_impl) ]
37
35
#![ feature( core_intrinsics) ]
You can’t perform that action at this time.
0 commit comments