Skip to content

Commit 012faa4

Browse files
GuillaumeGomezgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#131713 - tgross35:stabilize-const_maybe_uninit_write, r=RalfJung,dtolnay
Stabilize `const_maybe_uninit_write` Mark the following API const stable: ```rust 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`](rust-lang#86722), both of which have recently been stabilized. Closes: <rust-lang#63567>
2 parents c354a0a + 1a93a99 commit 012faa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)