about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-11-12 21:42:15 +0100
committerRalf Jung <post@ralfj.de>2024-11-12 21:42:15 +0100
commit324d05996206a5f2fc7a84e2ec9fc8503738dd92 (patch)
tree31a1598b8e40d3d5f1723253b15a374a6faf9ee6
parent6503543d11583d1686d4989847b2afbec8d9fdba (diff)
downloadrust-324d05996206a5f2fc7a84e2ec9fc8503738dd92.tar.gz
rust-324d05996206a5f2fc7a84e2ec9fc8503738dd92.zip
stabilize const_option_ext
-rw-r--r--library/core/src/lib.rs1
-rw-r--r--library/core/src/option.rs8
-rw-r--r--library/core/tests/lib.rs1
3 files changed, 4 insertions, 6 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 2f4f33dcc85..c20bb8d7876 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
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index b9706ea2a9e..f515e9e4109 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -21,7 +21,6 @@
 #![feature(const_eval_select)]
 #![feature(const_heap)]
 #![feature(const_nonnull_new)]
-#![feature(const_option_ext)]
 #![feature(const_pin_2)]
 #![feature(const_trait_impl)]
 #![feature(core_intrinsics)]