You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#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#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.
Fixesrust-lang#157015.
0 commit comments