diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-12 23:26:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-12 23:26:45 +0100 |
| commit | ae5c00f053d95b4424e05f684c1871ecc205a9f3 (patch) | |
| tree | 8eef9d28363cdc1698343efe7001668b69c5ee4f /library/core/src | |
| parent | b952f2ee4fc6dd4e5992cf12964ed7d9c0449676 (diff) | |
| parent | 324d05996206a5f2fc7a84e2ec9fc8503738dd92 (diff) | |
| download | rust-ae5c00f053d95b4424e05f684c1871ecc205a9f3.tar.gz rust-ae5c00f053d95b4424e05f684c1871ecc205a9f3.zip | |
Rollup merge of #132966 - RalfJung:const_option_ext, r=jhpratt
stabilize const_option_ext Fixes https://github.com/rust-lang/rust/issues/91930 FCP passed in that issue.
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/src/option.rs | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 1cc353befb8..6f7ea769420 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -120,7 +120,6 @@ #![feature(const_float_methods)] #![feature(const_heap)] #![feature(const_nonnull_new)] -#![feature(const_option_ext)] #![feature(const_pin_2)] #![feature(const_ptr_is_null)] #![feature(const_ptr_sub_ptr)] diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 46187938622..29d1956af95 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -738,7 +738,7 @@ impl<T> Option<T> { #[inline] #[must_use] #[stable(feature = "pin", since = "1.33.0")] - #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] + #[rustc_const_stable(feature = "const_option_ext", since = "CURRENT_RUSTC_VERSION")] pub const fn as_pin_ref(self: Pin<&Self>) -> Option<Pin<&T>> { // FIXME(const-hack): use `map` once that is possible match Pin::get_ref(self).as_ref() { @@ -755,7 +755,7 @@ impl<T> Option<T> { #[inline] #[must_use] #[stable(feature = "pin", since = "1.33.0")] - #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] + #[rustc_const_stable(feature = "const_option_ext", since = "CURRENT_RUSTC_VERSION")] pub const fn as_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut T>> { // SAFETY: `get_unchecked_mut` is never used to move the `Option` inside `self`. // `x` is guaranteed to be pinned because it comes from `self` which is pinned. @@ -802,7 +802,7 @@ impl<T> Option<T> { #[inline] #[must_use] #[stable(feature = "option_as_slice", since = "1.75.0")] - #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] + #[rustc_const_stable(feature = "const_option_ext", since = "CURRENT_RUSTC_VERSION")] pub const fn as_slice(&self) -> &[T] { // SAFETY: When the `Option` is `Some`, we're using the actual pointer // to the payload, with a length of 1, so this is equivalent to @@ -857,7 +857,7 @@ impl<T> Option<T> { #[inline] #[must_use] #[stable(feature = "option_as_slice", since = "1.75.0")] - #[rustc_const_unstable(feature = "const_option_ext", issue = "91930")] + #[rustc_const_stable(feature = "const_option_ext", since = "CURRENT_RUSTC_VERSION")] pub const fn as_mut_slice(&mut self) -> &mut [T] { // SAFETY: When the `Option` is `Some`, we're using the actual pointer // to the payload, with a length of 1, so this is equivalent to |
