From a51ad131e6ba90ec2da67f35a44531494a9f07f3 Mon Sep 17 00:00:00 2001 From: Urgau Date: Wed, 17 May 2023 14:54:56 +0200 Subject: Add diagnostic items for `ptr::cast_mut` and `ptr::from_ref` --- library/core/src/ptr/const_ptr.rs | 1 + library/core/src/ptr/mod.rs | 1 + 2 files changed, 2 insertions(+) (limited to 'library/core/src/ptr') diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 5ee1b5e4afc..5b4fecb1555 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -104,6 +104,7 @@ impl *const T { /// refactored. #[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_mut"] #[inline(always)] pub const fn cast_mut(self) -> *mut T { self as _ diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index ff9fa48f311..76a5249ab52 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -698,6 +698,7 @@ where #[inline(always)] #[must_use] #[unstable(feature = "ptr_from_ref", issue = "106116")] +#[rustc_diagnostic_item = "ptr_from_ref"] pub const fn from_ref(r: &T) -> *const T { r } -- cgit 1.4.1-3-g733a5