diff options
| author | Trevor Gross <tmgross@umich.edu> | 2024-10-14 18:32:54 -0400 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2024-12-02 14:06:56 -0500 |
| commit | c5fedc2267838ab9db5a98f946873685ae69097f (patch) | |
| tree | 1ec2d79385d93678df8a98d31168cc1412a07819 | |
| parent | 32eea2f4460b06b12acc98050a4211b8c0ccfd67 (diff) | |
| download | rust-c5fedc2267838ab9db5a98f946873685ae69097f.tar.gz rust-c5fedc2267838ab9db5a98f946873685ae69097f.zip | |
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: <https://github.com/rust-lang/rust/issues/63567>
| -rw-r--r-- | library/core/src/mem/maybe_uninit.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 3c1a098374e..9b3d6902098 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -485,9 +485,9 @@ impl<T> MaybeUninit<T> { /// } /// } /// ``` - #[stable(feature = "maybe_uninit_write", since = "1.55.0")] - #[rustc_const_unstable(feature = "const_maybe_uninit_write", issue = "63567")] #[inline(always)] + #[stable(feature = "maybe_uninit_write", since = "1.55.0")] + #[rustc_const_stable(feature = "const_maybe_uninit_write", since = "CURRENT_RUSTC_VERSION")] pub const fn write(&mut self, val: T) -> &mut T { *self = MaybeUninit::new(val); // SAFETY: We just initialized this value. |
