about summary refs log tree commit diff
path: root/library/core/src/ptr
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-07-13 14:11:29 +0200
committerUrgau <urgau@numericable.fr>2023-08-01 20:04:01 +0200
commit0b9529cca39d86138066012e85cae96ba4a7c253 (patch)
treec69455e713f5223ac951094ebec0c076d566a786 /library/core/src/ptr
parentef3413d423299039cdf807b2e9484e7825cc21cd (diff)
downloadrust-0b9529cca39d86138066012e85cae96ba4a7c253.tar.gz
rust-0b9529cca39d86138066012e85cae96ba4a7c253.zip
Add diagnostic items for `<*const _>::cast` and `ptr::from_mut`
Diffstat (limited to 'library/core/src/ptr')
-rw-r--r--library/core/src/ptr/mod.rs1
-rw-r--r--library/core/src/ptr/mut_ptr.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index acc9ca29d41..5f094ac4e7e 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -710,6 +710,7 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
 #[inline(always)]
 #[must_use]
 #[unstable(feature = "ptr_from_ref", issue = "106116")]
+#[rustc_diagnostic_item = "ptr_from_mut"]
 pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
     r
 }
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index e7f27439540..e3a3f69afd9 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -54,6 +54,7 @@ impl<T: ?Sized> *mut 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 = "ptr_cast"]
     #[inline(always)]
     pub const fn cast<U>(self) -> *mut U {
         self as _