@@ -312,42 +312,6 @@ impl<T> MaybeUninit<T> {
312
312
MaybeUninit { uninit : ( ) }
313
313
}
314
314
315
- /// Creates a new array of `MaybeUninit<T>` items, in an uninitialized state.
316
- ///
317
- /// Note: in a future Rust version this method may become unnecessary
318
- /// when Rust allows
319
- /// [inline const expressions](https://github.com/rust-lang/rust/issues/76001).
320
- /// The example below could then use `let mut buf = [const { MaybeUninit::<u8>::uninit() }; 32];`.
321
- ///
322
- /// # Examples
323
- ///
324
- /// ```no_run
325
- /// #![feature(maybe_uninit_uninit_array, maybe_uninit_slice)]
326
- ///
327
- /// use std::mem::MaybeUninit;
328
- ///
329
- /// extern "C" {
330
- /// fn read_into_buffer(ptr: *mut u8, max_len: usize) -> usize;
331
- /// }
332
- ///
333
- /// /// Returns a (possibly smaller) slice of data that was actually read
334
- /// fn read(buf: &mut [MaybeUninit<u8>]) -> &[u8] {
335
- /// unsafe {
336
- /// let len = read_into_buffer(buf.as_mut_ptr() as *mut u8, buf.len());
337
- /// MaybeUninit::slice_assume_init_ref(&buf[..len])
338
- /// }
339
- /// }
340
- ///
341
- /// let mut buf: [MaybeUninit<u8>; 32] = MaybeUninit::uninit_array();
342
- /// let data = read(&mut buf);
343
- /// ```
344
- #[ unstable( feature = "maybe_uninit_uninit_array" , issue = "96097" ) ]
345
- #[ must_use]
346
- #[ inline( always) ]
347
- pub const fn uninit_array < const N : usize > ( ) -> [ Self ; N ] {
348
- [ const { MaybeUninit :: uninit ( ) } ; N ]
349
- }
350
-
351
315
/// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
352
316
/// filled with `0` bytes. It depends on `T` whether that already makes for
353
317
/// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,
0 commit comments