Files
rust/compiler/rustc_parse
Jonathan Brouwer 3f0676c213 Rollup merge of #157079 - qaijuang:raw-expr-list-recovery, r=Kivooeo
Don't recover `&raw EXPR` as a missing comma

The parser already has a targeted suggestion for `&raw EXPR`, added in rust-lang/rust#139392, telling the user that `&raw` must be followed by `const` or `mut`.

In comma-separated expression lists, the generic missing-comma recovery would then treat the expression after `raw` as the next list element. That produced follow-up diagnostics like:

- `help: missing ','`
- `cannot find value raw in this scope`
- an arity error for calls such as `takes_raw_ptr(&raw x)`

This PR avoids that comma recovery when we are already in the `&raw` missing-`const`/`mut` diagnostic path. For function calls, it preserves the call expression with a single error argument, so useful later diagnostics such as `cannot find function f` are still emitted.

Fixes rust-lang/rust#157015.
2026-06-12 20:40:56 +02:00
..
2026-04-08 21:09:07 +02:00