Rollup merge of #76164 - lzutao:slice-array, r=ehuss
Link to slice pattern in array docs Fix a todo in https://github.com/rust-lang/reference/issues/739#issuecomment-578408449
This commit is contained in:
commit
3e156cfe90
1 changed files with 3 additions and 3 deletions
|
@ -510,7 +510,7 @@ mod prim_pointer {}
|
||||||
/// an array. Indeed, this provides most of the API for working with arrays.
|
/// an array. Indeed, this provides most of the API for working with arrays.
|
||||||
/// Slices have a dynamic size and do not coerce to arrays.
|
/// Slices have a dynamic size and do not coerce to arrays.
|
||||||
///
|
///
|
||||||
/// You can move elements out of an array with a slice pattern. If you want
|
/// You can move elements out of an array with a [slice pattern]. If you want
|
||||||
/// one element, see [`mem::replace`].
|
/// one element, see [`mem::replace`].
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
@ -552,7 +552,7 @@ mod prim_pointer {}
|
||||||
/// for x in &array { }
|
/// for x in &array { }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// You can use a slice pattern to move elements out of an array:
|
/// You can use a [slice pattern] to move elements out of an array:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// fn move_away(_: String) { /* Do interesting things. */ }
|
/// fn move_away(_: String) { /* Do interesting things. */ }
|
||||||
|
@ -567,7 +567,7 @@ mod prim_pointer {}
|
||||||
/// [`Hash`]: hash::Hash
|
/// [`Hash`]: hash::Hash
|
||||||
/// [`Borrow`]: borrow::Borrow
|
/// [`Borrow`]: borrow::Borrow
|
||||||
/// [`BorrowMut`]: borrow::BorrowMut
|
/// [`BorrowMut`]: borrow::BorrowMut
|
||||||
///
|
/// [slice pattern]: ../reference/patterns.html#slice-patterns
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
mod prim_array {}
|
mod prim_array {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue