diff --git a/src/doc/reference.md b/src/doc/reference.md index 8a2403c7fcdc6..172ab47c0e740 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); } ```