Skip to content

Reference: Update 7.2.20 (for loops) and fix formatting #24775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand All @@ -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);
}
```

Expand Down