Bad suggestion for tuple struct used in pattern with struct syntax and missing fields #80174
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
For the following code:
we currently emit
but struct patterns cannot refer to tuple field names with numbers, as the parser expects identifiers.
I think that 1) the parser should be changed to accept the positions, but ultimately reject them, suggesting to use the tuple syntax and 2) that the suggestion should be for the tuple syntax to begin with.
The text was updated successfully, but these errors were encountered: