Skip to content

Commit 1ed32c5

Browse files
committed
Stabilize const_maybe_uninit_write
Mark the following API const stable: impl<T> MaybeUninit<T> { pub const fn write(&mut self, val: T) -> &mut T; } This depends on `const_mut_refs` and `const_maybe_uninit_assume_init`, both of which have recently been stabilized. Tracking issue: <rust-lang#63567>
1 parent 9322d18 commit 1ed32c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
#![feature(const_box)]
111111
#![feature(const_eval_select)]
112112
#![feature(const_heap)]
113-
#![feature(const_maybe_uninit_write)]
114113
#![feature(const_pin)]
115114
#![feature(const_size_of_val)]
116115
#![feature(const_vec_string_slice)]

library/core/src/mem/maybe_uninit.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ impl<T> MaybeUninit<T> {
485485
/// }
486486
/// }
487487
/// ```
488-
#[stable(feature = "maybe_uninit_write", since = "1.55.0")]
489-
#[rustc_const_unstable(feature = "const_maybe_uninit_write", issue = "63567")]
490488
#[inline(always)]
489+
#[stable(feature = "maybe_uninit_write", since = "1.55.0")]
490+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
491+
#[rustc_const_stable(feature = "const_maybe_uninit_write", since = "CURRENT_RUSTC_VERSION")]
491492
pub const fn write(&mut self, val: T) -> &mut T {
492493
*self = MaybeUninit::new(val);
493494
// SAFETY: We just initialized this value.

0 commit comments

Comments
 (0)