diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2019-01-08 14:58:29 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2019-01-09 14:45:39 -0500 |
| commit | 4a454d629cfabe0501f8e5fe3586df313acea2d6 (patch) | |
| tree | bd8596f0ae53b61ba517810343a5c9356e57e860 /src/libstd | |
| parent | b8c8f0bdf62728198696cab7d00a8fdc3ee381d3 (diff) | |
| download | rust-4a454d629cfabe0501f8e5fe3586df313acea2d6.tar.gz rust-4a454d629cfabe0501f8e5fe3586df313acea2d6.zip | |
actually take a slice in this example
Fixes #45678
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/primitive_docs.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 475c9b4aeaa..c2751508ce0 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -550,7 +550,6 @@ mod prim_array { } #[doc(alias = "[")] #[doc(alias = "]")] #[doc(alias = "[]")] -// /// A dynamically-sized view into a contiguous sequence, `[T]`. /// /// *[See also the `std::slice` module](slice/index.html).* @@ -572,11 +571,11 @@ mod prim_array { } /// points to: /// /// ``` -/// let x = &mut [1, 2, 3]; +/// let mut x = [1, 2, 3]; +/// let x = &mut x[..]; // Take a full slice of `x`. /// x[1] = 7; /// assert_eq!(x, &[1, 7, 3]); /// ``` -/// #[stable(feature = "rust1", since = "1.0.0")] mod prim_slice { } |
