We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfc5c0f commit 52b5150Copy full SHA for 52b5150
src/libcore/ptr.rs
@@ -303,7 +303,7 @@ impl<T> PtrExt for *const T {
303
304
#[inline]
305
#[stable(feature = "rust1", since = "1.0.0")]
306
- fn is_null(self) -> bool { self as usize == 0 }
+ fn is_null(self) -> bool { self == 0 as *const T }
307
308
309
@@ -330,7 +330,7 @@ impl<T> PtrExt for *mut T {
330
331
332
333
+ fn is_null(self) -> bool { self == 0 as *mut T }
334
335
336
0 commit comments