|
78 | 78 | //! `std::i32`](i32/index.html) that documents the constant values [`MIN`] and
|
79 | 79 | //! [`MAX`] (rarely useful).
|
80 | 80 | //!
|
81 |
| -//! Note the documentation for the primitives [`str`] and [`[T]`] (also called |
82 |
| -//! 'slice'). Many method calls on [`String`] and [`Vec<T>`] are actually calls |
83 |
| -//! to methods on [`str`] and [`[T]`] respectively, via [deref coercions]. |
| 81 | +//! Note the documentation for the primitives [`str`] and [`[T]`][slice] (also |
| 82 | +//! called 'slice'). Many method calls on [`String`] and [`Vec<T>`] are actually |
| 83 | +//! calls to methods on [`str`] and [`[T]`][slice] respectively, via [deref |
| 84 | +//! coercions]. |
84 | 85 | //!
|
85 | 86 | //! Third, the standard library defines [The Rust Prelude], a small collection
|
86 | 87 | //! of items - mostly traits - that are imported into every module of every
|
|
109 | 110 | //! regions of memory:
|
110 | 111 | //!
|
111 | 112 | //! * [`Vec<T>`] - A heap-allocated *vector* that is resizable at runtime.
|
112 |
| -//! * [`[T; n]`] - An inline *array* with a fixed size at compile time. |
113 |
| -//! * [`[T]`] - A dynamically sized *slice* into any other kind of contiguous |
| 113 | +//! * [`[T; n]`][array] - An inline *array* with a fixed size at compile time. |
| 114 | +//! * [`[T]`][slice] - A dynamically sized *slice* into any other kind of contiguous |
114 | 115 | //! storage, whether heap-allocated or not.
|
115 | 116 | //!
|
116 | 117 | //! Slices can only be handled through some kind of *pointer*, and as such come
|
117 | 118 | //! in many flavors such as:
|
118 | 119 | //!
|
119 | 120 | //! * `&[T]` - *shared slice*
|
120 | 121 | //! * `&mut [T]` - *mutable slice*
|
121 |
| -//! * [`Box<[T]>`] - *owned slice* |
| 122 | +//! * [`Box<[T]>`][owned slice] - *owned slice* |
122 | 123 | //!
|
123 | 124 | //! [`str`], a UTF-8 string slice, is a primitive type, and the standard library
|
124 | 125 | //! defines many methods for it. Rust [`str`]s are typically accessed as
|
|
158 | 159 | //! [UDP]: net/struct.UdpSocket.html
|
159 | 160 | //! [`::std::env::args()`]: env/fn.args.html
|
160 | 161 | //! [`Arc`]: sync/struct.Arc.html
|
161 |
| -//! [`Box<[T]>`]: boxed/index.html |
| 162 | +//! [owned slice]: boxed/index.html |
162 | 163 | //! [`Cell`]: cell/struct.Cell.html
|
163 | 164 | //! [`FromStr`]: str/trait.FromStr.html
|
164 | 165 | //! [`HashMap<K, V>`]: collections/struct.HashMap.html
|
|
170 | 171 | //! [`Result<T, E>`]: result/enum.Result.html
|
171 | 172 | //! [`String`]: string/struct.String.html
|
172 | 173 | //! [`Vec<T>`]: vec/index.html
|
173 |
| -//! [`[T; n]`]: primitive.array.html |
174 |
| -//! [`[T]`]: primitive.slice.html |
| 174 | +//! [array]: primitive.array.html |
| 175 | +//! [slice]: primitive.slice.html |
175 | 176 | //! [`atomic`]: sync/atomic/index.html
|
176 | 177 | //! [`collections`]: collections/index.html
|
177 | 178 | //! [`for`]: ../book/loops.html#for
|
|
0 commit comments