Skip to content

Commit 744df28

Browse files
committed
Some fixes to std index docs
Part of rust-lang#29330 Needed because of rust-lang#29481 and rust-lang#29483
1 parent e2906db commit 744df28

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/libstd/lib.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@
7878
//! `std::i32`](i32/index.html) that documents the constant values [`MIN`] and
7979
//! [`MAX`] (rarely useful).
8080
//!
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].
8485
//!
8586
//! Third, the standard library defines [The Rust Prelude], a small collection
8687
//! of items - mostly traits - that are imported into every module of every
@@ -109,16 +110,16 @@
109110
//! regions of memory:
110111
//!
111112
//! * [`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
114115
//! storage, whether heap-allocated or not.
115116
//!
116117
//! Slices can only be handled through some kind of *pointer*, and as such come
117118
//! in many flavors such as:
118119
//!
119120
//! * `&[T]` - *shared slice*
120121
//! * `&mut [T]` - *mutable slice*
121-
//! * [`Box<[T]>`] - *owned slice*
122+
//! * [`Box<[T]>`][owned slice] - *owned slice*
122123
//!
123124
//! [`str`], a UTF-8 string slice, is a primitive type, and the standard library
124125
//! defines many methods for it. Rust [`str`]s are typically accessed as
@@ -158,7 +159,7 @@
158159
//! [UDP]: net/struct.UdpSocket.html
159160
//! [`::std::env::args()`]: env/fn.args.html
160161
//! [`Arc`]: sync/struct.Arc.html
161-
//! [`Box<[T]>`]: boxed/index.html
162+
//! [owned slice]: boxed/index.html
162163
//! [`Cell`]: cell/struct.Cell.html
163164
//! [`FromStr`]: str/trait.FromStr.html
164165
//! [`HashMap<K, V>`]: collections/struct.HashMap.html
@@ -170,8 +171,8 @@
170171
//! [`Result<T, E>`]: result/enum.Result.html
171172
//! [`String`]: string/struct.String.html
172173
//! [`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
175176
//! [`atomic`]: sync/atomic/index.html
176177
//! [`collections`]: collections/index.html
177178
//! [`for`]: ../book/loops.html#for

0 commit comments

Comments
 (0)