File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 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> {
390390 // want to keep their span info to improve diagnostics in these cases in a later stage.
391391 ( true , Some ( AssocOp :: Multiply ) ) | // `{ 42 } *foo = bar;` or `{ 42 } * 3`
392392 ( true , Some ( AssocOp :: Subtract ) ) | // `{ 42 } -5`
393- ( true , Some ( AssocOp :: Add ) ) | // `{ 42 } + 42
393+ ( true , Some ( AssocOp :: Add ) ) | // `{ 42 } + 42` (unary plus)
394394 ( 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+ => {
397398 // These cases are ambiguous and can't be identified in the parser alone.
398399 //
399400 // 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