Rollup merge of #36576 - GuillaumeGomez:box_urls, r=steveklabnik
Add missing urls for Box doc r? @steveklabnik
This commit is contained in:
@@ -244,12 +244,14 @@ impl<T: ?Sized> Box<T> {
|
|||||||
/// the destructor of `T` and free the allocated memory. Since the
|
/// the destructor of `T` and free the allocated memory. Since the
|
||||||
/// way `Box` allocates and releases memory is unspecified, the
|
/// way `Box` allocates and releases memory is unspecified, the
|
||||||
/// only valid pointer to pass to this function is the one taken
|
/// only valid pointer to pass to this function is the one taken
|
||||||
/// from another `Box` via the `Box::into_raw` function.
|
/// from another `Box` via the [`Box::into_raw`] function.
|
||||||
///
|
///
|
||||||
/// This function is unsafe because improper use may lead to
|
/// This function is unsafe because improper use may lead to
|
||||||
/// memory problems. For example, a double-free may occur if the
|
/// memory problems. For example, a double-free may occur if the
|
||||||
/// function is called twice on the same raw pointer.
|
/// function is called twice on the same raw pointer.
|
||||||
///
|
///
|
||||||
|
/// [`Box::into_raw`]: struct.Box.html#method.into_raw
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@@ -269,12 +271,14 @@ impl<T: ?Sized> Box<T> {
|
|||||||
/// memory previously managed by the `Box`. In particular, the
|
/// memory previously managed by the `Box`. In particular, the
|
||||||
/// caller should properly destroy `T` and release the memory. The
|
/// caller should properly destroy `T` and release the memory. The
|
||||||
/// proper way to do so is to convert the raw pointer back into a
|
/// proper way to do so is to convert the raw pointer back into a
|
||||||
/// `Box` with the `Box::from_raw` function.
|
/// `Box` with the [`Box::from_raw`] function.
|
||||||
///
|
///
|
||||||
/// Note: this is an associated function, which means that you have
|
/// Note: this is an associated function, which means that you have
|
||||||
/// to call it as `Box::into_raw(b)` instead of `b.into_raw()`. This
|
/// to call it as `Box::into_raw(b)` instead of `b.into_raw()`. This
|
||||||
/// is so that there is no conflict with a method on the inner type.
|
/// is so that there is no conflict with a method on the inner type.
|
||||||
///
|
///
|
||||||
|
/// [`Box::from_raw`]: struct.Box.html#method.from_raw
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Reference in New Issue
Block a user