File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 217217#![ feature( unboxed_closures) ]
218218#![ feature( unsized_fn_params) ]
219219#![ feature( asm_const) ]
220+ #![ feature( const_transmute_copy) ]
220221//
221222// Target features:
222223#![ feature( arm_target_feature) ]
Original file line number Diff line number Diff line change @@ -1297,7 +1297,8 @@ impl<T, const N: usize> MaybeUninit<[T; N]> {
12971297 /// let data: [MaybeUninit<u8>; 1000] = MaybeUninit::uninit().transpose();
12981298 /// ```
12991299 #[ unstable( feature = "maybe_uninit_uninit_array_transpose" , issue = "96097" ) ]
1300- pub fn transpose ( self ) -> [ MaybeUninit < T > ; N ] {
1300+ #[ inline]
1301+ pub const fn transpose ( self ) -> [ MaybeUninit < T > ; N ] {
13011302 // SAFETY: T and MaybeUninit<T> have the same layout
13021303 unsafe { super :: transmute_copy ( & ManuallyDrop :: new ( self ) ) }
13031304 }
@@ -1316,7 +1317,8 @@ impl<T, const N: usize> [MaybeUninit<T>; N] {
13161317 /// let data: MaybeUninit<[u8; 1000]> = data.transpose();
13171318 /// ```
13181319 #[ unstable( feature = "maybe_uninit_uninit_array_transpose" , issue = "96097" ) ]
1319- pub fn transpose ( self ) -> MaybeUninit < [ T ; N ] > {
1320+ #[ inline]
1321+ pub const fn transpose ( self ) -> MaybeUninit < [ T ; N ] > {
13201322 // SAFETY: T and MaybeUninit<T> have the same layout
13211323 unsafe { super :: transmute_copy ( & ManuallyDrop :: new ( self ) ) }
13221324 }
You can’t perform that action at this time.
0 commit comments