@@ -626,20 +626,37 @@ macro_rules! todo {
626626/// Creates an array of [`MaybeUninit`].
627627///
628628/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
629+ /// It exists solely because bootstrap does not yet support const array-init expressions.
629630///
630631/// [`MaybeUninit`]: mem/union.MaybeUninit.html
632+ // FIXME: Remove both versions of this macro once bootstrap is 1.38.
631633#[ macro_export]
632634#[ unstable( feature = "maybe_uninit_array" , issue = "53491" ) ]
633- macro_rules! uninitialized_array {
635+ #[ cfg( bootstrap) ]
636+ macro_rules! uninit_array {
634637 // This `assume_init` is safe because an array of `MaybeUninit` does not
635638 // require initialization.
636- // FIXME(#49147): Could be replaced by an array initializer, once those can
637- // be any const expression.
638639 ( $t: ty; $size: expr) => ( unsafe {
639640 MaybeUninit :: <[ MaybeUninit <$t>; $size] >:: uninit( ) . assume_init( )
640641 } ) ;
641642}
642643
644+ /// Creates an array of [`MaybeUninit`].
645+ ///
646+ /// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
647+ /// It exists solely because bootstrap does not yet support const array-init expressions.
648+ ///
649+ /// [`MaybeUninit`]: mem/union.MaybeUninit.html
650+ // FIXME: Just inline this version of the macro once bootstrap is 1.38.
651+ #[ macro_export]
652+ #[ unstable( feature = "maybe_uninit_array" , issue = "53491" ) ]
653+ #[ cfg( not( bootstrap) ) ]
654+ macro_rules! uninit_array {
655+ ( $t: ty; $size: expr) => (
656+ [ MaybeUninit :: <$t>:: uninit( ) ; $size]
657+ ) ;
658+ }
659+
643660/// Built-in macros to the compiler itself.
644661///
645662/// These macros do not have any corresponding definition with a `macro_rules!`
0 commit comments