File tree 1 file changed +4
-3
lines changed
compiler/rustc_parse/src/parser
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -390,10 +390,11 @@ impl<'a> Parser<'a> {
390
390
// want to keep their span info to improve diagnostics in these cases in a later stage.
391
391
( true , Some ( AssocOp :: Multiply ) ) | // `{ 42 } *foo = bar;` or `{ 42 } * 3`
392
392
( true , Some ( AssocOp :: Subtract ) ) | // `{ 42 } -5`
393
- ( true , Some ( AssocOp :: Add ) ) | // `{ 42 } + 42
393
+ ( true , Some ( AssocOp :: Add ) ) | // `{ 42 } + 42` (unary plus)
394
394
( true , Some ( AssocOp :: LAnd ) ) | // `{ 42 } &&x` (#61475) or `{ 42 } && if x { 1 } else { 0 }`
395
- ( true , Some ( AssocOp :: LOr ) ) |
396
- ( true , Some ( AssocOp :: BitOr ) ) => {
395
+ ( true , Some ( AssocOp :: LOr ) ) | // `{ 42 } || 42` ("logical or" or closure)
396
+ ( true , Some ( AssocOp :: BitOr ) ) // `{ 42 } | 42` or `{ 42 } |x| 42`
397
+ => {
397
398
// These cases are ambiguous and can't be identified in the parser alone.
398
399
//
399
400
// Bitwise AND is left out because guessing intent is hard. We can make
You can’t perform that action at this time.
0 commit comments