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 85
85
#![feature(fmt_internals)]
86
86
#![feature(fn_traits)]
87
87
#![feature(fundamental)]
88
+ #![feature(internal_uninit_const)]
88
89
#![feature(lang_items)]
89
90
#![feature(libc)]
90
91
#![feature(nll)]
Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ macro_rules! uninit_array {
653
653
#[cfg(not(bootstrap))]
654
654
macro_rules! uninit_array {
655
655
($t:ty; $size:expr) => (
656
- [MaybeUninit::<$t>::uninit() ; $size]
656
+ [MaybeUninit::<$t>::UNINIT ; $size]
657
657
);
658
658
}
659
659
Original file line number Diff line number Diff line change @@ -248,11 +248,18 @@ impl<T> MaybeUninit<T> {
248
248
/// [type]: union.MaybeUninit.html
249
249
#[stable(feature = "maybe_uninit", since = "1.36.0")]
250
250
#[inline(always)]
251
- #[rustc_promotable]
252
251
pub const fn uninit() -> MaybeUninit<T> {
253
252
MaybeUninit { uninit: () }
254
253
}
255
254
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
+
256
263
/// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
257
264
/// filled with `0` bytes. It depends on `T` whether that already makes for
258
265
/// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,
You can’t perform that action at this time.
0 commit comments