@@ -665,7 +665,6 @@ impl<T> MaybeUninit<T> {
665
665
/// ### Correct usage of this method:
666
666
///
667
667
/// ```rust
668
- /// #![feature(maybe_uninit_ref)]
669
668
/// use std::mem::MaybeUninit;
670
669
///
671
670
/// let mut x = MaybeUninit::<Vec<u32>>::uninit();
@@ -683,7 +682,6 @@ impl<T> MaybeUninit<T> {
683
682
/// ### *Incorrect* usages of this method:
684
683
///
685
684
/// ```rust,no_run
686
- /// #![feature(maybe_uninit_ref)]
687
685
/// use std::mem::MaybeUninit;
688
686
///
689
687
/// let x = MaybeUninit::<Vec<u32>>::uninit();
@@ -692,7 +690,6 @@ impl<T> MaybeUninit<T> {
692
690
/// ```
693
691
///
694
692
/// ```rust,no_run
695
- /// #![feature(maybe_uninit_ref)]
696
693
/// use std::{cell::Cell, mem::MaybeUninit};
697
694
///
698
695
/// let b = MaybeUninit::<Cell<bool>>::uninit();
@@ -703,7 +700,7 @@ impl<T> MaybeUninit<T> {
703
700
/// // Reference to an uninitialized `Cell<bool>`: UB!
704
701
/// }
705
702
/// ```
706
- #[ unstable ( feature = "maybe_uninit_ref" , issue = "63568 " ) ]
703
+ #[ stable ( feature = "maybe_uninit_ref" , since = "1.55.0 " ) ]
707
704
#[ rustc_const_unstable( feature = "const_maybe_uninit_assume_init" , issue = "none" ) ]
708
705
#[ inline( always) ]
709
706
pub const unsafe fn assume_init_ref ( & self ) -> & T {
@@ -733,7 +730,6 @@ impl<T> MaybeUninit<T> {
733
730
/// ### Correct usage of this method:
734
731
///
735
732
/// ```rust
736
- /// #![feature(maybe_uninit_ref)]
737
733
/// use std::mem::MaybeUninit;
738
734
///
739
735
/// # unsafe extern "C" fn initialize_buffer(buf: *mut [u8; 1024]) { *buf = [0; 1024] }
@@ -769,7 +765,6 @@ impl<T> MaybeUninit<T> {
769
765
/// You cannot use `.assume_init_mut()` to initialize a value:
770
766
///
771
767
/// ```rust,no_run
772
- /// #![feature(maybe_uninit_ref)]
773
768
/// use std::mem::MaybeUninit;
774
769
///
775
770
/// let mut b = MaybeUninit::<bool>::uninit();
@@ -785,7 +780,6 @@ impl<T> MaybeUninit<T> {
785
780
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
786
781
///
787
782
/// ```rust,no_run
788
- /// #![feature(maybe_uninit_ref)]
789
783
/// use std::{io, mem::MaybeUninit};
790
784
///
791
785
/// fn read_chunk (reader: &'_ mut dyn io::Read) -> io::Result<[u8; 64]>
@@ -802,7 +796,6 @@ impl<T> MaybeUninit<T> {
802
796
/// Nor can you use direct field access to do field-by-field gradual initialization:
803
797
///
804
798
/// ```rust,no_run
805
- /// #![feature(maybe_uninit_ref)]
806
799
/// use std::{mem::MaybeUninit, ptr};
807
800
///
808
801
/// struct Foo {
@@ -823,10 +816,7 @@ impl<T> MaybeUninit<T> {
823
816
/// foo.assume_init()
824
817
/// };
825
818
/// ```
826
- // FIXME(#76092): We currently rely on the above being incorrect, i.e., we have references
827
- // to uninitialized data (e.g., in `libcore/fmt/float.rs`). We should make
828
- // a final decision about the rules before stabilization.
829
- #[ unstable( feature = "maybe_uninit_ref" , issue = "63568" ) ]
819
+ #[ stable( feature = "maybe_uninit_ref" , since = "1.55.0" ) ]
830
820
#[ rustc_const_unstable( feature = "const_maybe_uninit_assume_init" , issue = "none" ) ]
831
821
#[ inline( always) ]
832
822
pub const unsafe fn assume_init_mut ( & mut self ) -> & mut T {
0 commit comments