File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,22 @@ match EXPR {
114114The expression cannot be a [ lazy boolean operator expression] [ _LazyBooleanOperatorExpression_ ] .
115115Use of a lazy boolean operator is ambiguous with a planned feature change
116116of the language (the implementation of if-let chains - see [ eRFC 2947] [ _eRFCIfLetChain_ ] ).
117+ When lazy boolean operator expression is desired, this can be achieved
118+ by using parenthesis as below:
119+
120+ ``` rust,ignore
121+ // Before...
122+ if let PAT = EXPR && EXPR { .. }
123+
124+ // After...
125+ if let PAT = ( EXPR && EXPR ) { .. }
126+
127+ // Before...
128+ if let PAT = EXPR || EXPR { .. }
129+
130+ // After...
131+ if let PAT = ( EXPR || EXPR ) { .. }
132+ ```
117133
118134[ _Expression_ ] : expressions.html
119135[ _BlockExpression_ ] : expressions/block-expr.html
You can’t perform that action at this time.
0 commit comments