mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
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.