diff --git a/src/expressions/if-expr.md b/src/expressions/if-expr.md index 87b088f78..591437fc9 100644 --- a/src/expressions/if-expr.md +++ b/src/expressions/if-expr.md @@ -41,7 +41,7 @@ assert_eq!(y, "Bigger"); > **Syntax**\ > _IfLetExpression_ :\ ->    `if` `let` [_Pattern_] `=` [_Expression_]_except struct or lazy boolean operator expression_ +>    `if` `let` [_Pattern_] `=` [_Scrutinee_]_except lazy boolean operator expression_ > [_BlockExpression_]\ >    (`else` ( > [_BlockExpression_] @@ -148,6 +148,7 @@ if let PAT = ( EXPR || EXPR ) { .. } [_Expression_]: ../expressions.md [_LazyBooleanOperatorExpression_]: operator-expr.md#lazy-boolean-operators [_Pattern_]: ../patterns.md +[_Scrutinee_]: match-expr.md [_eRFCIfLetChain_]: https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#rollout-plan-and-transitioning-to-rust-2018 [`match` expression]: match-expr.md [boolean type]: ../types/boolean.md diff --git a/src/expressions/loop-expr.md b/src/expressions/loop-expr.md index 8c9ad2802..1ca62095c 100644 --- a/src/expressions/loop-expr.md +++ b/src/expressions/loop-expr.md @@ -62,9 +62,10 @@ while i < 10 { > **Syntax**\ > [_PredicatePatternLoopExpression_] :\ ->    `while` `let` [_Pattern_] `=` [_Expression_]_except struct or lazy boolean operator expression_ +>    `while` `let` [_Pattern_] `=` [_Scrutinee_]_except lazy boolean operator expression_ > [_BlockExpression_] + A `while let` loop is semantically similar to a `while` loop but in place of a condition expression it expects the keyword `let` followed by a pattern, an `=`, a [scrutinee] expression and a block expression. If the value of the scrutinee matches the pattern, the loop body block executes then control returns to the pattern matching statement. Otherwise, the while expression completes. @@ -264,6 +265,7 @@ In the case a `loop` has an associated `break`, it is not considered diverging, [_BlockExpression_]: block-expr.md [_Expression_]: ../expressions.md [_Pattern_]: ../patterns.md +[_Scrutinee_]: match-expr.md [`match` expression]: match-expr.md [boolean]: ../types/boolean.md [scrutinee]: ../glossary.md#scrutinee diff --git a/src/expressions/match-expr.md b/src/expressions/match-expr.md index 53455fa9a..febf60cc3 100644 --- a/src/expressions/match-expr.md +++ b/src/expressions/match-expr.md @@ -2,11 +2,14 @@ > **Syntax**\ > _MatchExpression_ :\ ->    `match` [_Expression_]_except struct expression_ `{`\ +>    `match` _Scrutinee_ `{`\ >       [_InnerAttribute_]\*\ >       _MatchArms_?\ >    `}` > +>_Scrutinee_ :\ +>    [_Expression_]_except struct expression_ +> > _MatchArms_ :\ >    ( _MatchArm_ `=>` > ( [_ExpressionWithoutBlock_][_Expression_] `,`