Skip to content

Commit 9fb8f1b

Browse files
authored
Rollup merge of rust-lang#62469 - czipperz:liballoc-add-doc-links, r=GuillaumeGomez
Add doc links to liballoc crate page
2 parents d8280fa + 2534b28 commit 9fb8f1b

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/liballoc/lib.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@
1010
//!
1111
//! ## Boxed values
1212
//!
13-
//! The [`Box`](boxed/index.html) type is a smart pointer type. There can
14-
//! only be one owner of a `Box`, and the owner can decide to mutate the
15-
//! contents, which live on the heap.
13+
//! The [`Box`] type is a smart pointer type. There can only be one owner of a
14+
//! [`Box`], and the owner can decide to mutate the contents, which live on the
15+
//! heap.
1616
//!
1717
//! This type can be sent among threads efficiently as the size of a `Box` value
1818
//! is the same as that of a pointer. Tree-like data structures are often built
1919
//! with boxes because each node often has only one owner, the parent.
2020
//!
2121
//! ## Reference counted pointers
2222
//!
23-
//! The [`Rc`](rc/index.html) type is a non-threadsafe reference-counted pointer
24-
//! type intended for sharing memory within a thread. An `Rc` pointer wraps a
25-
//! type, `T`, and only allows access to `&T`, a shared reference.
23+
//! The [`Rc`] type is a non-threadsafe reference-counted pointer type intended
24+
//! for sharing memory within a thread. An [`Rc`] pointer wraps a type, `T`, and
25+
//! only allows access to `&T`, a shared reference.
2626
//!
27-
//! This type is useful when inherited mutability (such as using `Box`) is too
28-
//! constraining for an application, and is often paired with the `Cell` or
29-
//! `RefCell` types in order to allow mutation.
27+
//! This type is useful when inherited mutability (such as using [`Box`]) is too
28+
//! constraining for an application, and is often paired with the [`Cell`] or
29+
//! [`RefCell`] types in order to allow mutation.
3030
//!
3131
//! ## Atomically reference counted pointers
3232
//!
33-
//! The [`Arc`](sync/index.html) type is the threadsafe equivalent of the `Rc`
34-
//! type. It provides all the same functionality of `Rc`, except it requires
35-
//! that the contained type `T` is shareable. Additionally, `Arc<T>` is itself
36-
//! sendable while `Rc<T>` is not.
33+
//! The [`Arc`] type is the threadsafe equivalent of the [`Rc`] type. It
34+
//! provides all the same functionality of [`Rc`], except it requires that the
35+
//! contained type `T` is shareable. Additionally, [`Arc<T>`][`Arc`] is itself
36+
//! sendable while [`Rc<T>`][`Rc`] is not.
3737
//!
3838
//! This type allows for shared access to the contained data, and is often
3939
//! paired with synchronization primitives such as mutexes to allow mutation of
@@ -49,6 +49,12 @@
4949
//!
5050
//! The [`alloc`](alloc/index.html) module defines the low-level interface to the
5151
//! default global allocator. It is not compatible with the libc allocator API.
52+
//!
53+
//! [`Arc`]: sync/index.html
54+
//! [`Box`]: boxed/index.html
55+
//! [`Cell`]: ../core/cell/index.html
56+
//! [`Rc`]: rc/index.html
57+
//! [`RefCell`]: ../core/cell/index.html
5258
5359
#![allow(unused_attributes)]
5460
#![stable(feature = "alloc", since = "1.36.0")]

0 commit comments

Comments
 (0)