about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Habovstiak <martin.habovstiak@gmail.com>2022-08-10 17:22:58 +0200
committerMartin Habovstiak <martin.habovstiak@gmail.com>2022-08-10 17:22:58 +0200
commit2a3ce7890c2e2c0b8e249aacfef44302f2b4d92a (patch)
tree1b9f9d3ebcc31ce7c6619b7999ecb32d4d8e1b01
parentaffe0d3a00e92fa7885e3f5d2c5073fde432d154 (diff)
downloadrust-2a3ce7890c2e2c0b8e249aacfef44302f2b4d92a.tar.gz
rust-2a3ce7890c2e2c0b8e249aacfef44302f2b4d92a.zip
Stabilize ptr_const_cast
This stabilizes `ptr_const_cast` feature as was decided in a recent
[FCP](https://github.com/rust-lang/rust/issues/92675#issuecomment-1190660233)

Closes #92675
-rw-r--r--compiler/rustc_arena/src/lib.rs1
-rw-r--r--library/core/src/ptr/const_ptr.rs4
-rw-r--r--library/core/src/ptr/mut_ptr.rs4
3 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs
index a5f1cbc96da..6529f11100d 100644
--- a/compiler/rustc_arena/src/lib.rs
+++ b/compiler/rustc_arena/src/lib.rs
@@ -19,7 +19,6 @@
 #![feature(rustc_attrs)]
 #![cfg_attr(test, feature(test))]
 #![feature(strict_provenance)]
-#![feature(ptr_const_cast)]
 
 use smallvec::SmallVec;
 
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index e0655d68d2c..833b57005ab 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -95,8 +95,8 @@ impl<T: ?Sized> *const T {
     ///
     /// This is a bit safer than `as` because it wouldn't silently change the type if the code is
     /// refactored.
-    #[unstable(feature = "ptr_const_cast", issue = "92675")]
-    #[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
+    #[stable(feature = "ptr_const_cast", since = "1.65.0")]
+    #[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
     pub const fn cast_mut(self) -> *mut T {
         self as _
     }
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index fc3dd2a9b25..5576fa60fbf 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -100,8 +100,8 @@ impl<T: ?Sized> *mut T {
     /// coercion.
     ///
     /// [`cast_mut`]: #method.cast_mut
-    #[unstable(feature = "ptr_const_cast", issue = "92675")]
-    #[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
+    #[stable(feature = "ptr_const_cast", since = "1.65.0")]
+    #[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
     pub const fn cast_const(self) -> *const T {
         self as _
     }