Skip to content

Commit

Permalink
Rollup merge of rust-lang#76060 - pickfire:patch-12, r=jyn514
Browse files Browse the repository at this point in the history
Link vec doc to & reference

It is not always obvious that people could see the docs for `&`
especially for beginners, it also helps learnability.
  • Loading branch information
matklad authored Sep 4, 2020
2 parents 782fbd3 + 85146b9 commit a741240
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/alloc/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ use crate::raw_vec::RawVec;
/// # Slicing
///
/// A `Vec` can be mutable. Slices, on the other hand, are read-only objects.
/// To get a slice, use `&`. Example:
/// To get a [slice], use [`&`]. Example:
///
/// ```
/// fn read_slice(slice: &[usize]) {
Expand Down Expand Up @@ -288,6 +288,8 @@ use crate::raw_vec::RawVec;
/// [`insert`]: Vec::insert
/// [`reserve`]: Vec::reserve
/// [owned slice]: Box
/// [slice]: ../../std/primitive.slice.html
/// [`&`]: ../../std/primitive.reference.html
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
pub struct Vec<T> {
Expand Down

0 comments on commit a741240

Please sign in to comment.