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.
This commit is contained in:
Dylan DPC 2020-09-05 16:28:24 +02:00 committed by GitHub
commit 86cf7976e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,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]) {
@ -287,6 +287,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> {