rollup merge of #24665: sw17ch/document-complete-slice-syntax

The documentation doesn't appear to describe the `&foo[..]` syntax.

I tried looking in `primitive-types.html#slices` and `std/primitive.slice.html`.

There's an example of partially slicing an array in trpl and a mention of `&foo[..]` in [the standard library documentation](https://doc.rust-lang.org/std/primitive.slice.html), but neither place, from what I can see, actually describes the behavior of `&foo[..]`.

+r? @steveklabnik
This commit is contained in:
Alex Crichton 2015-04-21 15:23:15 -07:00
commit 1a6c18d660
1 changed files with 1 additions and 0 deletions

View File

@ -168,6 +168,7 @@ like arrays:
```rust
let a = [0, 1, 2, 3, 4];
let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3
let complete = &a[..]; // A slice containing all of the elements in a
```
Slices have type `&[T]`. Well talk about that `T` when we cover