From 7972fbb735ee49377e22096a1f7fc9c4bae0e289 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 24 Apr 2015 09:18:30 -0700 Subject: [PATCH 1/2] [reference] Fix missing formatting. --- src/doc/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index 1cedbf299c327..66b4e0f5a2402 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2503,7 +2503,7 @@ The currently implemented features of the reference compiler are: terms of encapsulation). If a feature is promoted to a language feature, then all existing programs will -start to receive compilation warnings about #[feature] directives which enabled +start to receive compilation warnings about `#![feature]` directives which enabled the new feature (because the directive is no longer necessary). However, if a feature is decided to be removed from the language, errors will be issued (if there isn't a parser error first). The directive in this case is no longer From 331821e3a0cceef5b3a3270a2af384460d0a0bdb Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 24 Apr 2015 09:19:51 -0700 Subject: [PATCH 2/2] [reference] Update 7.2.20: For expressions. * `for` loops now use `IntoIterator` instead of just `Iterator` * Simplify the example by removing unnecessary `Vec::iter` call. --- src/doc/reference.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index 66b4e0f5a2402..80bb5274430cd 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -3192,7 +3192,7 @@ for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ``` A `for` expression is a syntactic construct for looping over elements provided -by an implementation of `std::iter::Iterator`. +by an implementation of `std::iter::IntoIterator`. An example of a for loop over the contents of an array: @@ -3205,8 +3205,8 @@ An example of a for loop over the contents of an array: let v: &[Foo] = &[a, b, c]; -for e in v.iter() { - bar(*e); +for e in v { + bar(e); } ```