Skip to content

Commit

Permalink
Mention syntax ambiguity for eRFC 2947.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtwco committed Oct 3, 2018
1 parent 8e565cd commit 165c11a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/expressions/if-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ assert_eq!(y, "Bigger");

> **<sup>Syntax</sup>**\
> _IfLetExpression_ :\
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct expression_</sub>
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
> [_BlockExpression_]\
> &nbsp;&nbsp; (`else` (
> [_BlockExpression_]
Expand Down Expand Up @@ -111,6 +111,12 @@ match EXPR {
}
```

The expression cannot be a [lazy boolean operator expression][_LazyBooleanOperatorExpression_].
Use of a lazy boolean operator is ambiguous with a planned feature change
of the language (the implementation of if-let chains - see [eRFC 2947][_eRFCIfLetChain_]).

[_Expression_]: expressions.html
[_BlockExpression_]: expressions/block-expr.html
[_Pattern_]: patterns.html
[_LazyBooleanOperatorExpression_]: expressions/operator-expr.html#lazy-boolean-operators
[_eRFCIfLetChain_]: https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#rollout-plan-and-transitioning-to-rust-2018

0 comments on commit 165c11a

Please sign in to comment.