Skip to content

Commit

Permalink
Generalize Expr::Range bailout to any operator that can begin expr
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 10, 2025
1 parent d3f2879 commit fd198d9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/fixup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,13 @@ fn scan_right(
Scan::Fail
}
}
None => match fixup.next_operator {
Precedence::Range => Scan::Consume,
_ => Scan::Fail,
},
None => {
if fixup.next_operator_can_begin_expr {
Scan::Consume
} else {
Scan::Fail
}
}
},
Expr::Break(e) => match &e.expr {
Some(value) => {
Expand Down

0 comments on commit fd198d9

Please sign in to comment.