Custom diagnostic for bad mut
in pattern with sub-bindings
#63764
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given (as brought up in #63693 (comment) CC @Centril):
We currently emit a parse error:
It should instead parse as if it were
let Foo { x: mut x } = Foo { x: 3 };
(medium priority), silence any complaints thatmut
is unnecessary (lower priority) and emit a custom error explaining thatmut
cannot lead a pattern with subpatterns (must have), and suggest the appropriatemut
placement in the sub-bindings (nice to have):The text was updated successfully, but these errors were encountered: