Skip to content

Commit 7808838

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: <#63567>
1 parent 1350eea commit 7808838

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
#![feature(const_box)]
112112
#![feature(const_eval_select)]
113113
#![feature(const_heap)]
114-
#![feature(const_maybe_uninit_write)]
115114
#![feature(const_size_of_val)]
116115
#![feature(const_vec_string_slice)]
117116
#![feature(core_intrinsics)]

library/core/src/mem/maybe_uninit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ 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+
#[rustc_const_stable(feature = "const_maybe_uninit_write", since = "CURRENT_RUSTC_VERSION")]
491491
pub const fn write(&mut self, val: T) -> &mut T {
492492
*self = MaybeUninit::new(val);
493493
// SAFETY: We just initialized this value.

0 commit comments

Comments
 (0)