Skip to content

Commit 39c0d35

Browse files
committed
Merge pull request rust-lang#3734 from dbp/tutorial-fixes
tutorial: add note about mutability of vectors
2 parents 91315c3 + c33bff9 commit 39c0d35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/tutorial.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ while count < 10 {
216216

217217
Although Rust can almost always infer the types of local variables, you
218218
can specify a variable's type by following it with a colon, then the type
219-
name.
219+
name.
220220

221221
~~~~
222222
let monster_size: float = 57.8;
@@ -381,6 +381,10 @@ of:
381381
`[mut T]` Mutable vector with unknown size
382382
------------------------- -----------------------------------------------
383383

384+
> ***Note***: In the future, mutability for vectors may be defined by
385+
> the slot that contains the vector, not the type of the vector itself,
386+
> deprecating [mut T] syntax.
387+
384388
In function types, the return type is specified with an arrow, as in
385389
the type `fn() -> bool` or the function declaration `fn foo() -> bool
386390
{ }`. For functions that do not return a meaningful value, you can
@@ -1951,7 +1955,7 @@ trait Printable {
19511955
~~~~
19521956

19531957
Traits may be implemented for specific types with [impls]. An impl
1954-
that implements a trait includes the name of the trait at the start of
1958+
that implements a trait includes the name of the trait at the start of
19551959
the definition, as in the following impls of `Printable` for `int`
19561960
and `~str`.
19571961

0 commit comments

Comments
 (0)