Skip to content

Commit 63f2c22

Browse files
Add missing doc links in boxed module
1 parent 765eebf commit 63f2c22

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/liballoc/boxed.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! A pointer type for heap allocation.
22
//!
3-
//! `Box<T>`, casually referred to as a 'box', provides the simplest form of
3+
//! [`Box<T>`], casually referred to as a 'box', provides the simplest form of
44
//! heap allocation in Rust. Boxes provide ownership for this allocation, and
55
//! drop their contents when they go out of scope.
66
//!
@@ -48,7 +48,7 @@
4848
//!
4949
//! It wouldn't work. This is because the size of a `List` depends on how many
5050
//! elements are in the list, and so we don't know how much memory to allocate
51-
//! for a `Cons`. By introducing a `Box`, which has a defined size, we know how
51+
//! for a `Cons`. By introducing a [`Box<T>`], which has a defined size, we know how
5252
//! big `Cons` needs to be.
5353
//!
5454
//! # Memory layout
@@ -59,15 +59,19 @@
5959
//! [`Layout`] used with the allocator is correct for the type. More precisely,
6060
//! a `value: *mut T` that has been allocated with the [`Global`] allocator
6161
//! with `Layout::for_value(&*value)` may be converted into a box using
62-
//! `Box::<T>::from_raw(value)`. Conversely, the memory backing a `value: *mut
63-
//! T` obtained from `Box::<T>::into_raw` may be deallocated using the
64-
//! [`Global`] allocator with `Layout::for_value(&*value)`.
62+
//! [`Box::<T>::from_raw(value)`]. Conversely, the memory backing a `value: *mut
63+
//! T` obtained from [`Box::<T>::into_raw`] may be deallocated using the
64+
//! [`Global`] allocator with [`Layout::for_value(&*value)`].
6565
//!
6666
//!
6767
//! [dereferencing]: ../../std/ops/trait.Deref.html
6868
//! [`Box`]: struct.Box.html
69+
//! [`Box<T>`]: struct.Box.html
70+
//! [`Box::<T>::from_raw(value)`]: struct.Box.html#method.from_raw
71+
//! [`Box::<T>::into_raw`]: struct.Box.html#method.into_raw
6972
//! [`Global`]: ../alloc/struct.Global.html
7073
//! [`Layout`]: ../alloc/struct.Layout.html
74+
//! [`Layout::for_value(&*value)`]: ../alloc/struct.Layout.html#method.for_value
7175
7276
#![stable(feature = "rust1", since = "1.0.0")]
7377

0 commit comments

Comments
 (0)