We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e325146 commit 3b8097dCopy full SHA for 3b8097d
src/libcore/ptr.rs
@@ -49,7 +49,13 @@ fn mut_offset<T>(ptr: *mut T, count: uint) -> *mut T {
49
50
#[doc = "Create an unsafe null pointer"]
51
#[inline(always)]
52
-fn null<T>() -> *T unsafe { ret unsafe::reinterpret_cast(0u); }
+pure fn null<T>() -> *T unsafe { ret unsafe::reinterpret_cast(0u); }
53
+
54
+#[doc = "Returns true if the pointer is equal to the null pointer"]
55
+pure fn is_null<T>(ptr: *const T) -> bool { ptr == null() }
56
57
+#[doc = "Returns true if the pointer is not equal to the null pointer"]
58
+pure fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
59
60
#[doc = "
61
Copies data from one location to another
0 commit comments