Skip to content

Commit 86cf797

Browse files
authored
Rollup merge of #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 4bd3f26 + 85146b9 commit 86cf797

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
@@ -159,7 +159,7 @@ use crate::raw_vec::RawVec;
159159
/// # Slicing
160160
///
161161
/// A `Vec` can be mutable. Slices, on the other hand, are read-only objects.
162-
/// To get a slice, use `&`. Example:
162+
/// To get a [slice], use [`&`]. Example:
163163
///
164164
/// ```
165165
/// fn read_slice(slice: &[usize]) {
@@ -287,6 +287,8 @@ use crate::raw_vec::RawVec;
287287
/// [`insert`]: Vec::insert
288288
/// [`reserve`]: Vec::reserve
289289
/// [owned slice]: Box
290+
/// [slice]: ../../std/primitive.slice.html
291+
/// [`&`]: ../../std/primitive.reference.html
290292
#[stable(feature = "rust1", since = "1.0.0")]
291293
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
292294
pub struct Vec<T> {

0 commit comments

Comments
 (0)