@@ -426,7 +426,6 @@ impl<T> MaybeUninit<T> {
426426 /// Correct usage of this method:
427427 ///
428428 /// ```rust
429- /// #![feature(maybe_uninit_extra)]
430429 /// use std::mem::MaybeUninit;
431430 ///
432431 /// let mut x = MaybeUninit::<Vec<u8>>::uninit();
@@ -445,7 +444,6 @@ impl<T> MaybeUninit<T> {
445444 /// This usage of the method causes a leak:
446445 ///
447446 /// ```rust
448- /// #![feature(maybe_uninit_extra)]
449447 /// use std::mem::MaybeUninit;
450448 ///
451449 /// let mut x = MaybeUninit::<String>::uninit();
@@ -456,8 +454,8 @@ impl<T> MaybeUninit<T> {
456454 /// // x is initialized now:
457455 /// let s = unsafe { x.assume_init() };
458456 /// ```
459- #[ unstable ( feature = "maybe_uninit_extra " , issue = "63567 " ) ]
460- #[ rustc_const_unstable( feature = "maybe_uninit_extra " , issue = "63567" ) ]
457+ #[ stable ( feature = "maybe_uninit_write " , since = "1.55.0 " ) ]
458+ #[ rustc_const_unstable( feature = "const_maybe_uninit_write " , issue = "63567" ) ]
461459 #[ inline( always) ]
462460 pub const fn write ( & mut self , val : T ) -> & mut T {
463461 * self = MaybeUninit :: new ( val) ;
@@ -478,7 +476,7 @@ impl<T> MaybeUninit<T> {
478476 /// use std::mem::MaybeUninit;
479477 ///
480478 /// let mut x = MaybeUninit::<Vec<u32>>::uninit();
481- /// unsafe { x.as_mut_ptr(). write(vec![0, 1, 2]); }
479+ /// x. write(vec![0, 1, 2]);
482480 /// // Create a reference into the `MaybeUninit<T>`. This is okay because we initialized it.
483481 /// let x_vec = unsafe { &*x.as_ptr() };
484482 /// assert_eq!(x_vec.len(), 3);
@@ -897,9 +895,9 @@ impl<T> MaybeUninit<T> {
897895 /// use std::mem::MaybeUninit;
898896 ///
899897 /// let mut array: [MaybeUninit<i32>; 3] = MaybeUninit::uninit_array();
900- /// array[0] = MaybeUninit::new (0);
901- /// array[1] = MaybeUninit::new (1);
902- /// array[2] = MaybeUninit::new (2);
898+ /// array[0].write (0);
899+ /// array[1].write (1);
900+ /// array[2].write (2);
903901 ///
904902 /// // SAFETY: Now safe as we initialised all elements
905903 /// let array = unsafe {
0 commit comments