- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
enum Foo { Bar, Baz, } fn main() { let myfoo = Foo::Bar; match myfoo { Foo::Bar => {} Foo:Baz => {} // OOPS: I forgot a colon here } }On the playground (rustc 1.53), here's what I see:
error: expected one of `=>`, `@`, `if`, or `|`, found `:` --> src/main.rs:10:12 | 10 | Foo:Baz => {} | ^ expected one of `=>`, `@`, `if`, or `|` It would be nice if rustc could say "hey it looks like you forgot a colon" here, similar to this case.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.