Closed
Description
This erroneous code:
let std::ops::Range{ bar @ .. } = 0..0;
Produces this error message
error: expected `,`
--> src/main.rs:2:26
|
2 | let std::ops::Range{ bar @ .. } = 0..0;
| ^^^
It would be better if instead it produced an error message like this:
error: `bar @` is not allowed in a struct
--> src/main.rs:2:26
|
2 | let std::ops::Range{ bar @ .. } = 0..0;
| ^^^
= help: remove this and bind each struct field independently
help: if you don't need to use the contents of bar, discard the struct's remaining fields
|
11 | let std::ops::Range{ .. } = 0..0;
| ^^
Meta
Tried the code in these Rust versions and they all produced the same error message:
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTRelating to patterns and pattern matchingCategory: An issue proposing an enhancement or a PR with one.Diagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Call for participation: Help is requested to fix this issue.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Relevant to the compiler team, which will review and decide on the PR/issue.