Terse parse error on ident @ pat
in destructuring assignment
#134778
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
A-patterns
Relating to patterns and pattern matching
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following slice pattern:
Now, consider the following destructuring assignment with a slice pattern, including a "rest" pattern:
Now, consider the following destructuring assignment with a slice pattern, again in this Playground:
...that wasn't really what I expected! But then, I don't know what I did expect, honestly. It's possible this is "just" a diagnostic issue, but this is one of the somewhat sharper inconsistencies to discover here. I suspect gating this during parsing is not the correct thing to do here, even if we want to error on it.
@rustbot label: +C-bug +T-compiler +T-lang +D-confusing +A-parser +A-slice-patterns
The text was updated successfully, but these errors were encountered: