Skip to content

Commit 4081222

Browse files
committed
apply feedback
1 parent f502bf7 commit 4081222

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/libstd/primitive_docs.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,11 @@ mod prim_unit { }
363363
/// *[See also the `std::ptr` module](ptr/index.html).*
364364
///
365365
/// 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
367367
/// 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.
370371
///
371372
/// Use the [`null`] and [`null_mut`] functions to create null pointers, and the
372373
/// [`is_null`] method of the `*const T` and `*mut T` types to check for null.
@@ -896,7 +897,8 @@ mod prim_usize { }
896897
/// operators on a value, or by using a `ref` or `ref mut` pattern.
897898
///
898899
/// 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
900902
/// nullable but aligned pointer, and can be passed across FFI boundaries as such.
901903
///
902904
/// In most cases, references can be used much like the original value. Field access, method

0 commit comments

Comments
 (0)