Skip to content

Commit c987f30

Browse files
author
Nathaniel Ringo
committed
Mention null_mut on the pointer primitive docs.
Also adds a few mentions that both `*const` and `*mut` support functions, when only `*const` was mentioned before.
1 parent a24e0f2 commit c987f30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/primitive_docs.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ mod prim_unit { }
188188
/// Working with raw pointers in Rust is uncommon,
189189
/// typically limited to a few patterns.
190190
///
191-
/// Use the [`null`] function to create null pointers, and the [`is_null`] method
192-
/// of the `*const T` type to check for null. The `*const T` type also defines
193-
/// the [`offset`] method, for pointer math.
191+
/// Use the [`null`] and [`null_mut`] functions to create null pointers, and the
192+
/// [`is_null`] method of the `*const T` and `*mut T` types to check for null.
193+
/// The `*const T` and `*mut T` types also define the [`offset`] method, for
194+
/// pointer math.
194195
///
195196
/// # Common ways to create raw pointers
196197
///
@@ -261,6 +262,7 @@ mod prim_unit { }
261262
/// *[See also the `std::ptr` module](ptr/index.html).*
262263
///
263264
/// [`null`]: ../std/ptr/fn.null.html
265+
/// [`null_mut`]: ../std/ptr/fn.null_mut.html
264266
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
265267
/// [`offset`]: ../std/primitive.pointer.html#method.offset
266268
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw

0 commit comments

Comments
 (0)