Rollup merge of #83568 - RalfJung:uninit_array, r=dtolnay

update comment at MaybeUninit::uninit_array

https://github.com/rust-lang/rust/issues/49147 is closed; this now instead needs inline const expressions (#76001).
This commit is contained in:
Dylan DPC
2021-03-30 11:34:23 +02:00
committed by GitHub

View File

@@ -319,9 +319,9 @@ impl<T> MaybeUninit<T> {
/// Create a new array of `MaybeUninit<T>` items, in an uninitialized state. /// Create a new array of `MaybeUninit<T>` items, in an uninitialized state.
/// ///
/// Note: in a future Rust version this method may become unnecessary /// Note: in a future Rust version this method may become unnecessary
/// when array literal syntax allows /// when Rust allows
/// [repeating const expressions](https://github.com/rust-lang/rust/issues/49147). /// [inline const expressions](https://github.com/rust-lang/rust/issues/76001).
/// The example below could then use `let mut buf = [MaybeUninit::<u8>::uninit(); 32];`. /// The example below could then use `let mut buf = [const { MaybeUninit::<u8>::uninit() }; 32];`.
/// ///
/// # Examples /// # Examples
/// ///