@@ -363,12 +363,12 @@ 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`]. However, when a raw pointer is
367
367
/// dereferenced (using the `*` operator), it must be non-null and aligned.
368
368
///
369
369
/// Storing through a raw pointer using `*ptr = data` calls `drop` on the old value, so
370
370
/// [`write`] must be used if the type has drop glue and memory is not already
371
- /// initialized--- otherwise `drop` would be called on the uninitialized memory.
371
+ /// initialized - otherwise `drop` would be called on the uninitialized memory.
372
372
///
373
373
/// Use the [`null`] and [`null_mut`] functions to create null pointers, and the
374
374
/// [`is_null`] method of the `*const T` and `*mut T` types to check for null.
@@ -898,7 +898,10 @@ mod prim_usize { }
898
898
/// operators on a value, or by using a `ref` or `ref mut` pattern.
899
899
///
900
900
/// For those familiar with pointers, a reference is just a pointer that is assumed to be
901
- /// aligned, not null, and pointing to valid (initialized) memory.
901
+ /// aligned, not null, and pointing to memory containing a valid value of `T` - for example,
902
+ /// `&bool` can only point to an allocation containing the integer values `1` (`true`) or `0`
903
+ /// (`false`), but the behavior of creating a `&bool` that points to an allocation containing
904
+ /// the value `3` is undefined.
902
905
/// In fact, `Option<&T>` has the same memory representation as a
903
906
/// nullable but aligned pointer, and can be passed across FFI boundaries as such.
904
907
///
0 commit comments