@@ -332,42 +332,6 @@ impl<T> MaybeUninit<T> {
332332 MaybeUninit { uninit : ( ) }
333333 }
334334
335- /// Creates a new array of `MaybeUninit<T>` items, in an uninitialized state.
336- ///
337- /// Note: in a future Rust version this method may become unnecessary
338- /// when Rust allows
339- /// [inline const expressions](https://github.com/rust-lang/rust/issues/76001).
340- /// The example below could then use `let mut buf = [const { MaybeUninit::<u8>::uninit() }; 32];`.
341- ///
342- /// # Examples
343- ///
344- /// ```no_run
345- /// #![feature(maybe_uninit_uninit_array, maybe_uninit_slice)]
346- ///
347- /// use std::mem::MaybeUninit;
348- ///
349- /// extern "C" {
350- /// fn read_into_buffer(ptr: *mut u8, max_len: usize) -> usize;
351- /// }
352- ///
353- /// /// Returns a (possibly smaller) slice of data that was actually read
354- /// fn read(buf: &mut [MaybeUninit<u8>]) -> &[u8] {
355- /// unsafe {
356- /// let len = read_into_buffer(buf.as_mut_ptr() as *mut u8, buf.len());
357- /// buf[..len].assume_init_ref()
358- /// }
359- /// }
360- ///
361- /// let mut buf: [MaybeUninit<u8>; 32] = MaybeUninit::uninit_array();
362- /// let data = read(&mut buf);
363- /// ```
364- #[ unstable( feature = "maybe_uninit_uninit_array" , issue = "96097" ) ]
365- #[ must_use]
366- #[ inline( always) ]
367- pub const fn uninit_array < const N : usize > ( ) -> [ Self ; N ] {
368- [ const { MaybeUninit :: uninit ( ) } ; N ]
369- }
370-
371335 /// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
372336 /// filled with `0` bytes. It depends on `T` whether that already makes for
373337 /// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,
0 commit comments