diff --git a/core/src/ptr/mod.rs b/core/src/ptr/mod.rs index acc9ca29d..5f094ac4e 100644 --- a/core/src/ptr/mod.rs +++ b/core/src/ptr/mod.rs @@ -710,6 +710,7 @@ pub const fn from_ref(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(r: &mut T) -> *mut T { r } diff --git a/core/src/ptr/mut_ptr.rs b/core/src/ptr/mut_ptr.rs index e7f274395..e3a3f69af 100644 --- a/core/src/ptr/mut_ptr.rs +++ b/core/src/ptr/mut_ptr.rs @@ -54,6 +54,7 @@ impl *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(self) -> *mut U { self as _