Files
Jonathan Brouwer f5c2bd7a83 Rollup merge of #158376 - ChronoCoders:diag-eq-gt-closure-arg, r=chenyukang
Suggest `>=` for `=>` typo in closure and call argument positions

The parser suggests replacing `=>` with `>=` when it looks like a typo in a comparison, but it skipped the suggestion whenever a comma was an expected token. That excluded closure bodies used as call arguments, such as `iter.position(|x| x => &y)`, which is the case reported in rust-lang/rust#149805.

The comma exclusion was there to avoid suggesting `>=` for a missing comma between match arms, where `=>` is a real arm arrow. Those cases have a close brace in the expected token set, while the comparison cases do not, so this gates on the close brace instead of the comma. The existing `if`/`let`/`match` cases keep working, and the missing-comma-in-match suggestion is unaffected.

Fixes rust-lang/rust#149805
2026-06-26 20:22:20 +02:00
..