Skip to content

Commit 30a4742

Browse files
authored
Rollup merge of rust-lang#76060 - pickfire:patch-12, r=jyn514
Link vec doc to & reference It is not always obvious that people could see the docs for `&` especially for beginners, it also helps learnability.
2 parents 5886e94 + 85146b9 commit 30a4742

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/alloc/src/vec.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ use crate::raw_vec::RawVec;
160160
/// # Slicing
161161
///
162162
/// A `Vec` can be mutable. Slices, on the other hand, are read-only objects.
163-
/// To get a slice, use `&`. Example:
163+
/// To get a [slice], use [`&`]. Example:
164164
///
165165
/// ```
166166
/// fn read_slice(slice: &[usize]) {
@@ -288,6 +288,8 @@ use crate::raw_vec::RawVec;
288288
/// [`insert`]: Vec::insert
289289
/// [`reserve`]: Vec::reserve
290290
/// [owned slice]: Box
291+
/// [slice]: ../../std/primitive.slice.html
292+
/// [`&`]: ../../std/primitive.reference.html
291293
#[stable(feature = "rust1", since = "1.0.0")]
292294
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
293295
pub struct Vec<T> {

0 commit comments

Comments
 (0)