Skip to content

Commit 165c11a

Browse files
committed
Mention syntax ambiguity for eRFC 2947.
1 parent 8e565cd commit 165c11a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/expressions/if-expr.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ assert_eq!(y, "Bigger");
4444

4545
> **<sup>Syntax</sup>**\
4646
> _IfLetExpression_ :\
47-
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct expression_</sub>
47+
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
4848
> [_BlockExpression_]\
4949
> &nbsp;&nbsp; (`else` (
5050
> [_BlockExpression_]
@@ -111,6 +111,12 @@ match EXPR {
111111
}
112112
```
113113

114+
The expression cannot be a [lazy boolean operator expression][_LazyBooleanOperatorExpression_].
115+
Use of a lazy boolean operator is ambiguous with a planned feature change
116+
of the language (the implementation of if-let chains - see [eRFC 2947][_eRFCIfLetChain_]).
117+
114118
[_Expression_]: expressions.html
115119
[_BlockExpression_]: expressions/block-expr.html
116120
[_Pattern_]: patterns.html
121+
[_LazyBooleanOperatorExpression_]: expressions/operator-expr.html#lazy-boolean-operators
122+
[_eRFCIfLetChain_]: https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#rollout-plan-and-transitioning-to-rust-2018

0 commit comments

Comments
 (0)