File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 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() {
130130
131131A ` for ` expression is a syntactic construct for looping over elements provided
132132by 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.
136136
137137An example of a ` for ` loop over the contents of an array:
138138
Original file line number Diff line number Diff line change @@ -56,13 +56,13 @@ fn outer() {
5656>   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > ` let ` [ _ Pattern_ ]
5757> ( ` : ` [ _ Type_ ] )<sup >?</sup > (` = ` [ _ Expression_ ] )<sup >?</sup > ` ; `
5858
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.
6666
6767## Expression statements
6868
You can’t perform that action at this time.
0 commit comments