about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-13 17:11:03 +0000
committerbors <bors@rust-lang.org>2023-10-13 17:11:03 +0000
commit57ef8898520f7ff2c60341636bb86d94cb550e79 (patch)
tree1090b54723db200c61afb1412d562592f45cd291
parent985795270e35998d08d5069b45cde0a9c3dfc54b (diff)
parent58ed8ad0dfd224fbdd77ba38f4f9f71d9261674b (diff)
downloadrust-57ef8898520f7ff2c60341636bb86d94cb550e79.tar.gz
rust-57ef8898520f7ff2c60341636bb86d94cb550e79.zip
Auto merge of #116233 - DaniPopes:stabilize-const_maybe_uninit_assume_init_read, r=dtolnay
Stabilize `const_maybe_uninit_assume_init_read`

AFAICT the only reason this was not included in the `maybe_uninit_extra` stabilization was because `ptr::read` was unstable (https://github.com/rust-lang/rust/pull/92768#issuecomment-1011101383), which has since been stabilized in 1.71.

Needs a separate FCP from the [original `maybe_uninit_extra` one](https://github.com/rust-lang/rust/issues/63567#issuecomment-964428807).

Tracking issue: #63567
-rw-r--r--library/core/src/mem/maybe_uninit.rs5
-rw-r--r--library/core/tests/lib.rs1
2 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index d09a24b4b1d..6274a916f3e 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -686,7 +686,10 @@ impl<T> MaybeUninit<T> {
     /// // they both get dropped!
     /// ```
     #[stable(feature = "maybe_uninit_extra", since = "1.60.0")]
-    #[rustc_const_unstable(feature = "const_maybe_uninit_assume_init_read", issue = "63567")]
+    #[rustc_const_stable(
+        feature = "const_maybe_uninit_assume_init_read",
+        since = "CURRENT_RUSTC_VERSION"
+    )]
     #[inline(always)]
     #[track_caller]
     pub const unsafe fn assume_init_read(&self) -> T {
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 1a01efa5ba9..79601c8c19d 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -15,7 +15,6 @@
 #![feature(const_hash)]
 #![feature(const_heap)]
 #![feature(const_maybe_uninit_as_mut_ptr)]
-#![feature(const_maybe_uninit_assume_init_read)]
 #![feature(const_nonnull_new)]
 #![feature(const_pointer_byte_offsets)]
 #![feature(const_pointer_is_aligned)]