File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 8585#![ feature( fmt_internals) ]
8686#![ feature( fn_traits) ]
8787#![ feature( fundamental) ]
88+ #![ feature( internal_uninit_const) ]
8889#![ feature( lang_items) ]
8990#![ feature( libc) ]
9091#![ feature( nll) ]
Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ macro_rules! uninit_array {
653653#[ cfg( not( bootstrap) ) ]
654654macro_rules! uninit_array {
655655 ( $t: ty; $size: expr) => (
656- [ MaybeUninit :: <$t>:: uninit ( ) ; $size]
656+ [ MaybeUninit :: <$t>:: UNINIT ; $size]
657657 ) ;
658658}
659659
Original file line number Diff line number Diff line change @@ -248,11 +248,18 @@ impl<T> MaybeUninit<T> {
248248 /// [type]: union.MaybeUninit.html
249249 #[ stable( feature = "maybe_uninit" , since = "1.36.0" ) ]
250250 #[ inline( always) ]
251- #[ rustc_promotable]
252251 pub const fn uninit ( ) -> MaybeUninit < T > {
253252 MaybeUninit { uninit : ( ) }
254253 }
255254
255+ /// A promotable constant, equivalent to `uninit()`.
256+ #[ unstable(
257+ feature = "internal_uninit_const" ,
258+ issue = "0" ,
259+ reason = "hack to work around promotability" ,
260+ ) ]
261+ pub const UNINIT : Self = Self :: uninit ( ) ;
262+
256263 /// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
257264 /// filled with `0` bytes. It depends on `T` whether that already makes for
258265 /// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,
You can’t perform that action at this time.
0 commit comments