about summary refs log tree commit diff
diff options
context:
space:
mode:
authorultrabear <bearodark@gmail.com>2024-09-18 20:08:52 -0700
committerultrabear <bearodark@gmail.com>2024-09-18 20:22:02 -0700
commit7477f3eb350f37fbd376929b6b82b9e6bdd7621f (patch)
tree54ce192d17905522380c1d9f930503796054edf8
parenta5cf8bbd4e1c8edeae08778c85c6f806dd00e853 (diff)
downloadrust-7477f3eb350f37fbd376929b6b82b9e6bdd7621f.tar.gz
rust-7477f3eb350f37fbd376929b6b82b9e6bdd7621f.zip
stabilize `const_maybe_uninit_as_mut_ptr`
-rw-r--r--library/core/src/mem/maybe_uninit.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index 0154caa7c24..d274445f5e4 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -393,7 +393,6 @@ impl<T> MaybeUninit<T> {
     // These are OK to allow since we do not leak &mut to user-visible API
     #[rustc_allow_const_fn_unstable(const_mut_refs)]
     #[rustc_allow_const_fn_unstable(const_ptr_write)]
-    #[rustc_allow_const_fn_unstable(const_maybe_uninit_as_mut_ptr)]
     #[rustc_const_stable(feature = "const_maybe_uninit_zeroed", since = "1.75.0")]
     pub const fn zeroed() -> MaybeUninit<T> {
         let mut u = MaybeUninit::<T>::uninit();
@@ -570,7 +569,8 @@ impl<T> MaybeUninit<T> {
     /// (Notice that the rules around references to uninitialized data are not finalized yet, but
     /// until they are, it is advisable to avoid them.)
     #[stable(feature = "maybe_uninit", since = "1.36.0")]
-    #[rustc_const_unstable(feature = "const_maybe_uninit_as_mut_ptr", issue = "75251")]
+    #[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "CURRENT_RUSTC_VERSION")]
+    #[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
     #[inline(always)]
     pub const fn as_mut_ptr(&mut self) -> *mut T {
         // `MaybeUninit` and `ManuallyDrop` are both `repr(transparent)` so we can cast the pointer.