@@ -363,10 +363,11 @@ mod prim_unit { }
363
363
/// *[See also the `std::ptr` module](ptr/index.html).*
364
364
///
365
365
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366
- /// Raw pointers can be unaligned or null when unused. However, when a raw pointer is
366
+ /// Raw pointers can be unaligned or [` null`] when unused. However, when a raw pointer is
367
367
/// dereferenced (using the `*` operator), it must be non-null and aligned.
368
- /// Storing through a raw pointer (`*ptr = data`) calls `drop` on the old value, so
369
- /// [`write`] must be used if memory is not already initialized.
368
+ /// Storing through a raw pointer using `*ptr = data` calls `drop` on the old value, so
369
+ /// [`write`] must be used if memory is not already initialized---otherwise `drop`
370
+ /// would be called on the uninitialized memory.
370
371
///
371
372
/// Use the [`null`] and [`null_mut`] functions to create null pointers, and the
372
373
/// [`is_null`] method of the `*const T` and `*mut T` types to check for null.
@@ -896,7 +897,8 @@ mod prim_usize { }
896
897
/// operators on a value, or by using a `ref` or `ref mut` pattern.
897
898
///
898
899
/// For those familiar with pointers, a reference is just a pointer that is assumed to be
899
- /// aligned and not null. In fact, `Option<&T>` has the same memory representation as a
900
+ /// aligned, not null, and pointing to valid (initialized) memory.
901
+ /// In fact, `Option<&T>` has the same memory representation as a
900
902
/// nullable but aligned pointer, and can be passed across FFI boundaries as such.
901
903
///
902
904
/// In most cases, references can be used much like the original value. Field access, method
0 commit comments