@@ -45,7 +45,7 @@ have type compatible with the value of the `break` expression(s).
4545
4646> ** <sup >Syntax</sup >** \
4747> _ PredicateLoopExpression_ :\
48- >   ;  ; ` while ` [ _ Expression_ ] <sub >except struct expression </sub > [ _ BlockExpression_ ]
48+ >   ;  ; ` while ` [ _ Expression_ ] <sub >_ except struct expression _ </sub > [ _ BlockExpression_ ]
4949
5050A ` while ` loop begins by evaluating the boolean loop conditional expression. If
5151the loop conditional expression evaluates to ` true ` , the loop body block
@@ -67,7 +67,7 @@ while i < 10 {
6767
6868> ** <sup >Syntax</sup >** \
6969> [ _ PredicatePatternLoopExpression_ ] :\
70- >   ;  ; ` while ` ` let ` [ _ MatchArmPatterns_ ] ` = ` [ _ Expression_ ] <sub >except struct expression </sub >
70+ >   ;  ; ` while ` ` let ` [ _ MatchArmPatterns_ ] ` = ` [ _ Expression_ ] <sub >_ except struct or lazy boolean operator expression _ </sub >
7171> [ _ BlockExpression_ ]
7272
7373A ` while let ` loop is semantically similar to a ` while ` loop but in place of a
@@ -123,11 +123,32 @@ while let Some(v @ 1) | Some(v @ 2) = vals.pop() {
123123}
124124```
125125
126+ The expression cannot be a [ lazy boolean operator expression] [ _LazyBooleanOperatorExpression_ ] .
127+ Use of a lazy boolean operator is ambiguous with a planned feature change
128+ of the language (the implementation of if-let chains - see [ eRFC 2947] [ _eRFCIfLetChain_ ] ).
129+ When lazy boolean operator expression is desired, this can be achieved
130+ by using parenthesis as below:
131+
132+ <!-- ignore: psuedo code -->
133+ ``` rust,ignore
134+ // Before...
135+ while let PAT = EXPR && EXPR { .. }
136+
137+ // After...
138+ while let PAT = ( EXPR && EXPR ) { .. }
139+
140+ // Before...
141+ while let PAT = EXPR || EXPR { .. }
142+
143+ // After...
144+ while let PAT = ( EXPR || EXPR ) { .. }
145+ ```
146+
126147## Iterator loops
127148
128149> ** <sup >Syntax</sup >** \
129150> _ IteratorLoopExpression_ :\
130- >   ;  ; ` for ` [ _ Pattern_ ] ` in ` [ _ Expression_ ] <sub >except struct expression </sub >
151+ >   ;  ; ` for ` [ _ Pattern_ ] ` in ` [ _ Expression_ ] <sub >_ except struct expression _ </sub >
131152> [ _ BlockExpression_ ]
132153
133154A ` for ` expression is a syntactic construct for looping over elements provided
0 commit comments