Skip to content

Commit d35181a

Browse files
committed
Auto merge of #60445 - RalfJung:maybe-uninit, r=Centril
stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future (1.40.0). This is part of implementing rust-lang/rfcs#1892. Also expand the documentation a bit. This type is currently primarily useful when dealing with partially initialized arrays. In libstd, it is used e.g. in `BTreeMap` (with some unstable APIs that however can all be replaced, less ergonomically, by stable ones). What we stabilize should also be enough for `SmallVec` (Cc @bluss). Making this useful for structs requires rust-lang/rfcs#2582 or a commitment that references to uninitialized data are not insta-UB.
2 parents 589beb9 + 1916391 commit d35181a

File tree

8 files changed

+198
-232
lines changed

8 files changed

+198
-232
lines changed

src/liballoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
#![feature(rustc_const_unstable)]
110110
#![feature(const_vec_new)]
111111
#![feature(slice_partition_dedup)]
112-
#![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
112+
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
113113
#![feature(alloc_layout_extra)]
114114
#![feature(try_trait)]
115115
#![feature(iter_nth_back)]

src/libcore/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
#![feature(structural_match)]
126126
#![feature(abi_unadjusted)]
127127
#![feature(adx_target_feature)]
128-
#![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
128+
#![feature(maybe_uninit_slice, maybe_uninit_array)]
129129
#![feature(external_doc)]
130130

131131
#[prelude_import]

0 commit comments

Comments
 (0)