Skip to content

Commit

Permalink
Unrolled build for rust-lang#131274
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#131274 - workingjubilee:stabilize-the-one-that-got-away, r=scottmcm

library: Const-stabilize `MaybeUninit::assume_init_mut`

FCP completed in rust-lang#86722 (comment)

Also moves const-ness of an unstable fn under the `maybe_uninit_slice` gate, Cc rust-lang#63569
  • Loading branch information
rust-timer authored Oct 14, 2024
2 parents f6648f2 + 0b00a54 commit 5ad545d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
#![feature(const_ipv6)]
#![feature(const_likely)]
#![feature(const_make_ascii)]
#![feature(const_maybe_uninit_assume_init)]
#![feature(const_nonnull_new)]
#![feature(const_num_midpoint)]
#![feature(const_option_ext)]
Expand Down
9 changes: 7 additions & 2 deletions library/core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,11 @@ impl<T> MaybeUninit<T> {
/// };
/// ```
#[stable(feature = "maybe_uninit_ref", since = "1.55.0")]
#[rustc_const_unstable(feature = "const_maybe_uninit_assume_init", issue = "none")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(
feature = "const_maybe_uninit_assume_init",
since = "CURRENT_RUSTC_VERSION"
)]
#[inline(always)]
pub const unsafe fn assume_init_mut(&mut self) -> &mut T {
// SAFETY: the caller must guarantee that `self` is initialized.
Expand Down Expand Up @@ -999,7 +1003,8 @@ impl<T> MaybeUninit<T> {
///
/// [`assume_init_mut`]: MaybeUninit::assume_init_mut
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[rustc_const_unstable(feature = "const_maybe_uninit_assume_init", issue = "none")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[inline(always)]
pub const unsafe fn slice_assume_init_mut(slice: &mut [Self]) -> &mut [T] {
// SAFETY: similar to safety notes for `slice_get_ref`, but we have a
Expand Down

0 comments on commit 5ad545d

Please sign in to comment.