File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,9 @@ while let Some(v @ 1) | Some(v @ 2) = vals.pop() {
130
130
131
131
A ` for ` expression is a syntactic construct for looping over elements provided
132
132
by an implementation of ` std::iter::IntoIterator ` . If the iterator yields a
133
- value, that value is given the specified name and the body of the loop is
134
- executed, then control returns to the head of the ` for ` loop. If the iterator
135
- is empty, the ` for ` expression completes.
133
+ value, that value is matched against the irrefutable pattern, the body of the
134
+ loop is executed, and then control returns to the head of the ` for ` loop. If the
135
+ iterator is empty, the ` for ` expression completes.
136
136
137
137
An example of a ` for ` loop over the contents of an array:
138
138
Original file line number Diff line number Diff line change @@ -56,13 +56,13 @@ fn outer() {
56
56
>   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > ` let ` [ _ Pattern_ ]
57
57
> ( ` : ` [ _ Type_ ] )<sup >?</sup > (` = ` [ _ Expression_ ] )<sup >?</sup > ` ; `
58
58
59
- A * ` let ` statement* introduces a new set of [ variables] , given by a [ pattern ] . The
60
- pattern is followed optionally by a type annotation and then optionally by an
61
- initializer expression. When no type annotation is given, the compiler will
62
- infer the type, or signal an error if insufficient type information is
63
- available for definite inference. Any variables introduced by a variable
64
- declaration are visible from the point of declaration until the end of the
65
- enclosing block scope.
59
+ A * ` let ` statement* introduces a new set of [ variables] , given by an
60
+ irrefutable [ pattern] . The pattern is followed optionally by a type
61
+ annotation and then optionally by an initializer expression. When no
62
+ type annotation is given, the compiler will infer the type, or signal
63
+ an error if insufficient type information is available for definite
64
+ inference. Any variables introduced by a variable declaration are visible
65
+ from the point of declaration until the end of the enclosing block scope.
66
66
67
67
## Expression statements
68
68
You can’t perform that action at this time.
0 commit comments