Skip to content

Commit

Permalink
Auto merge of rust-lang#116233 - DaniPopes:stabilize-const_maybe_unin…
Browse files Browse the repository at this point in the history
…it_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 (rust-lang#92768 (comment)), which has since been stabilized in 1.71.

Needs a separate FCP from the [original `maybe_uninit_extra` one](rust-lang#63567 (comment)).

Tracking issue: rust-lang#63567
  • Loading branch information
bors committed Oct 13, 2023
2 parents 9857952 + 58ed8ad commit 57ef889
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion library/core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 57ef889

Please sign in to comment.