diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 1346ad19fe20a..04d2b205a272d 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -78,8 +78,8 @@ impl LeafNode { LeafNode { // As a general policy, we leave fields uninitialized if they can be, as this should // be both slightly faster and easier to track in Valgrind. - keys: [MaybeUninit::UNINIT; CAPACITY], - vals: [MaybeUninit::UNINIT; CAPACITY], + keys: MaybeUninit::uninit_array(), + vals: MaybeUninit::uninit_array(), parent: ptr::null(), parent_idx: MaybeUninit::uninit(), len: 0, @@ -111,7 +111,7 @@ impl InternalNode { /// `len` of 0), there must be one initialized and valid edge. This function does not set up /// such an edge. unsafe fn new() -> Self { - InternalNode { data: unsafe { LeafNode::new() }, edges: [MaybeUninit::UNINIT; 2 * B] } + InternalNode { data: unsafe { LeafNode::new() }, edges: MaybeUninit::uninit_array() } } } diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 2ced10831e75c..b338e5b2de7a4 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -100,7 +100,6 @@ #![feature(fn_traits)] #![feature(fundamental)] #![feature(inplace_iteration)] -#![feature(internal_uninit_const)] #![feature(lang_items)] #![feature(layout_for_ptr)] #![feature(libc)] @@ -134,7 +133,7 @@ #![feature(unsized_locals)] #![feature(allocator_internals)] #![feature(slice_partition_dedup)] -#![feature(maybe_uninit_extra, maybe_uninit_slice)] +#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)] #![feature(alloc_layout_extra)] #![feature(trusted_random_access)] #![feature(try_trait)] diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index b64abf68c5e4a..2a353670a91fa 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -305,14 +305,6 @@ impl MaybeUninit { unsafe { MaybeUninit::<[MaybeUninit; LEN]>::uninit().assume_init() } } - /// A promotable constant, equivalent to `uninit()`. - #[unstable( - feature = "internal_uninit_const", - issue = "none", - reason = "hack to work around promotability" - )] - pub const UNINIT: Self = Self::uninit(); - /// Creates a new `MaybeUninit` in an uninitialized state, with the memory being /// filled with `0` bytes. It depends on `T` whether that already makes for /// proper initialization. For example, `MaybeUninit::zeroed()` is initialized,