diff options
| author | Urgau <urgau@numericable.fr> | 2023-05-17 14:54:56 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2023-05-31 12:26:36 +0200 |
| commit | a51ad131e6ba90ec2da67f35a44531494a9f07f3 (patch) | |
| tree | b8459562f6dd21085ad31b43b9753bb503e6e6b7 | |
| parent | 617d3d6d722c432cdcbf210e6db55c3bdeafe381 (diff) | |
| download | rust-a51ad131e6ba90ec2da67f35a44531494a9f07f3.tar.gz rust-a51ad131e6ba90ec2da67f35a44531494a9f07f3.zip | |
Add diagnostic items for `ptr::cast_mut` and `ptr::from_ref`
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ptr/const_ptr.rs | 1 | ||||
| -rw-r--r-- | library/core/src/ptr/mod.rs | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 1185563ea80..2f002e42427 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1146,6 +1146,8 @@ symbols! { profiler_builtins, profiler_runtime, ptr, + ptr_cast_mut, + ptr_from_ref, ptr_guaranteed_cmp, ptr_mask, ptr_null, 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<T: ?Sized> *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<T: ?Sized>(r: &T) -> *const T { r } |
