Skip to content

Commit 5e3ffa9

Browse files
committed
add lint deref_nullptr
1 parent 1597416 commit 5e3ffa9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/ptr/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
211211
#[stable(feature = "rust1", since = "1.0.0")]
212212
#[rustc_promotable]
213213
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
214+
#[rustc_diagnostic_item = "ptr_null"]
214215
pub const fn null<T>() -> *const T {
215216
0 as *const T
216217
}
@@ -229,6 +230,7 @@ pub const fn null<T>() -> *const T {
229230
#[stable(feature = "rust1", since = "1.0.0")]
230231
#[rustc_promotable]
231232
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
233+
#[rustc_diagnostic_item = "ptr_null_mut"]
232234
pub const fn null_mut<T>() -> *mut T {
233235
0 as *mut T
234236
}

0 commit comments

Comments
 (0)