about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-08-14 11:47:42 +0200
committerUrgau <urgau@numericable.fr>2023-08-15 10:14:41 +0200
commit6933848fbff3da5bfcd78ab836cda15e3f649ffc (patch)
tree762ecc70c88353dfdb26819a0d4150ffc1631b8d
parent570601f0aad3e0f07f14684d5cbedd1c1c96b1c9 (diff)
downloadrust-6933848fbff3da5bfcd78ab836cda15e3f649ffc.tar.gz
rust-6933848fbff3da5bfcd78ab836cda15e3f649ffc.zip
Add diagnostic items for `<*const _>::cast` and `<*mut _>::cast_const`
-rw-r--r--compiler/rustc_span/src/symbol.rs2
-rw-r--r--library/core/src/ptr/const_ptr.rs1
-rw-r--r--library/core/src/ptr/mut_ptr.rs1
3 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 745a3590720..f66b1e8970b 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -543,6 +543,7 @@ symbols! {
         const_panic_fmt,
         const_param_ty,
         const_precise_live_drops,
+        const_ptr_cast,
         const_raw_ptr_deref,
         const_raw_ptr_to_usize_cast,
         const_refs_to_cell,
@@ -1159,6 +1160,7 @@ symbols! {
         profiler_runtime,
         ptr,
         ptr_cast,
+        ptr_cast_const,
         ptr_cast_mut,
         ptr_const_is_null,
         ptr_from_mut,
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index 502f8a75863..ee69d89a4b7 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -55,6 +55,7 @@ impl<T: ?Sized> *const T {
     /// Casts to a pointer of another type.
     #[stable(feature = "ptr_cast", since = "1.38.0")]
     #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")]
+    #[rustc_diagnostic_item = "const_ptr_cast"]
     #[inline(always)]
     pub const fn cast<U>(self) -> *const U {
         self as _
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index d129e1d645f..9dbb3f9d322 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -112,6 +112,7 @@ impl<T: ?Sized> *mut T {
     /// [`cast_mut`]: #method.cast_mut
     #[stable(feature = "ptr_const_cast", since = "1.65.0")]
     #[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
+    #[rustc_diagnostic_item = "ptr_cast_const"]
     #[inline(always)]
     pub const fn cast_const(self) -> *const T {
         self as _