Skip to content

Commit

Permalink
Document that there are many possible null pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 29, 2017
1 parent 8b2e09f commit 5c61183
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libcore/ptr.rs
Expand Up @@ -476,6 +476,11 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
impl<T: ?Sized> *const T {
/// Returns `true` if the pointer is null.
///
/// Note that unsized types have many possible null pointers, as only the
/// raw data pointer is considered, not their length, vtable, etc.
/// Therefore, two pointers that are null may still not compare equal to
/// each other.
///
/// # Examples
///
/// Basic usage:
Expand Down Expand Up @@ -1109,6 +1114,11 @@ impl<T: ?Sized> *const T {
impl<T: ?Sized> *mut T {
/// Returns `true` if the pointer is null.
///
/// Note that unsized types have many possible null pointers, as only the
/// raw data pointer is considered, not their length, vtable, etc.
/// Therefore, two pointers that are null may still not compare equal to
/// each other.
///
/// # Examples
///
/// Basic usage:
Expand Down

0 comments on commit 5c61183

Please sign in to comment.