Rollup merge of #40703 - GuillaumeGomez:pointer-docs, r=steveklabnik
Add missing urls in ptr docs r? @rust-lang/docs
This commit is contained in:
@@ -183,9 +183,9 @@ mod prim_unit { }
|
|||||||
/// Working with raw pointers in Rust is uncommon,
|
/// Working with raw pointers in Rust is uncommon,
|
||||||
/// typically limited to a few patterns.
|
/// typically limited to a few patterns.
|
||||||
///
|
///
|
||||||
/// Use the `null` function to create null pointers, and the `is_null` method
|
/// Use the [`null`] function to create null pointers, and the [`is_null`] method
|
||||||
/// of the `*const T` type to check for null. The `*const T` type also defines
|
/// of the `*const T` type to check for null. The `*const T` type also defines
|
||||||
/// the `offset` method, for pointer math.
|
/// the [`offset`] method, for pointer math.
|
||||||
///
|
///
|
||||||
/// # Common ways to create raw pointers
|
/// # Common ways to create raw pointers
|
||||||
///
|
///
|
||||||
@@ -213,7 +213,7 @@ mod prim_unit { }
|
|||||||
///
|
///
|
||||||
/// ## 2. Consume a box (`Box<T>`).
|
/// ## 2. Consume a box (`Box<T>`).
|
||||||
///
|
///
|
||||||
/// The `into_raw` function consumes a box and returns
|
/// The [`into_raw`] function consumes a box and returns
|
||||||
/// the raw pointer. It doesn't destroy `T` or deallocate any memory.
|
/// the raw pointer. It doesn't destroy `T` or deallocate any memory.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@@ -227,7 +227,7 @@ mod prim_unit { }
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Note that here the call to `drop` is for clarity - it indicates
|
/// Note that here the call to [`drop`] is for clarity - it indicates
|
||||||
/// that we are done with the given value and it should be destroyed.
|
/// that we are done with the given value and it should be destroyed.
|
||||||
///
|
///
|
||||||
/// ## 3. Get it from C.
|
/// ## 3. Get it from C.
|
||||||
@@ -255,6 +255,11 @@ mod prim_unit { }
|
|||||||
///
|
///
|
||||||
/// *[See also the `std::ptr` module](ptr/index.html).*
|
/// *[See also the `std::ptr` module](ptr/index.html).*
|
||||||
///
|
///
|
||||||
|
/// [`null`]: ../std/ptr/fn.null.html
|
||||||
|
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
|
||||||
|
/// [`offset`]: ../std/primitive.pointer.html#method.offset
|
||||||
|
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
|
||||||
|
/// [`drop`]: ../std/mem/fn.drop.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
mod prim_pointer { }
|
mod prim_pointer { }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user