diff --git a/src/expressions/loop-expr.md b/src/expressions/loop-expr.md index e37235a30..3bff9adaf 100644 --- a/src/expressions/loop-expr.md +++ b/src/expressions/loop-expr.md @@ -45,7 +45,7 @@ have type compatible with the value of the `break` expression(s). > **Syntax**\ > _PredicateLoopExpression_ :\ ->    `while` [_Expression_]except struct expression [_BlockExpression_] +>    `while` [_Expression_]_except struct expression_ [_BlockExpression_] A `while` loop begins by evaluating the boolean loop conditional expression. If the loop conditional expression evaluates to `true`, the loop body block @@ -67,7 +67,7 @@ while i < 10 { > **Syntax**\ > [_PredicatePatternLoopExpression_] :\ ->    `while` `let` [_MatchArmPatterns_] `=` [_Expression_]except struct expression +>    `while` `let` [_MatchArmPatterns_] `=` [_Expression_]_except struct or lazy boolean operator expression_ > [_BlockExpression_] A `while let` loop is semantically similar to a `while` loop but in place of a @@ -123,11 +123,13 @@ while let Some(v @ 1) | Some(v @ 2) = vals.pop() { } ``` +As is the case in [`if let` expressions], the scrutinee cannot be a [lazy boolean operator expression][_LazyBooleanOperatorExpression_]. + ## Iterator loops > **Syntax**\ > _IteratorLoopExpression_ :\ ->    `for` [_Pattern_] `in` [_Expression_]except struct expression +>    `for` [_Pattern_] `in` [_Expression_]_except struct expression_ > [_BlockExpression_] A `for` expression is a syntactic construct for looping over elements provided @@ -294,3 +296,5 @@ expression `()`. [`match` expression]: match-expr.md [scrutinee]: ../glossary.md#scrutinee [temporary values]: ../expressions.md#temporary-lifetimes +[_LazyBooleanOperatorExpression_]: operator-expr.md#lazy-boolean-operators +[`if let` expressions]: if-expr.md#if-let-expressions