Skip to content

Commit c808d0b

Browse files
author
Lukas Markeffsky
committed
more comments
1 parent 35c00a9 commit c808d0b

File tree

1 file changed

+4
-3
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+4
-3
lines changed

compiler/rustc_parse/src/parser/expr.rs

+4-3
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)