about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-05-17 16:49:18 +0200
committerUrgau <urgau@numericable.fr>2023-07-03 18:52:23 +0200
commit1e377c16fe93b893056bb1d661e16453bd2f7d24 (patch)
treef5835a587fe294d32bd9bfa1e76a93fca2d99b27
parentf798ada7babac06d4611b0b3a6079d8399ab58ab (diff)
downloadrust-1e377c16fe93b893056bb1d661e16453bd2f7d24.tar.gz
rust-1e377c16fe93b893056bb1d661e16453bd2f7d24.zip
Add diagnostic items for `<*mut _>::is_null` and `<*const _>::is_null`
-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 c58d85b99f7..95702a5e3cd 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1151,8 +1151,10 @@ symbols! {
         profiler_runtime,
         ptr,
         ptr_cast_mut,
+        ptr_const_is_null,
         ptr_from_ref,
         ptr_guaranteed_cmp,
+        ptr_is_null,
         ptr_mask,
         ptr_null,
         ptr_null_mut,
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index 926189a17b2..74046a9c7c3 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -30,6 +30,7 @@ impl<T: ?Sized> *const T {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
+    #[rustc_diagnostic_item = "ptr_const_is_null"]
     #[inline]
     pub const fn is_null(self) -> bool {
         #[inline]
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index c6f43857887..e7f27439540 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -29,6 +29,7 @@ impl<T: ?Sized> *mut T {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
+    #[rustc_diagnostic_item = "ptr_is_null"]
     #[inline]
     pub const fn is_null(self) -> bool {
         #[inline]