Closed

Description
UPDATE: Mentoring instructions below.
enum Foo { A, B, }
fn main() {
match &Foo::A {
&Foo::A => "art"
&Foo::B => "bart"
};
}
rustc
reports this error:
error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, `}`, or an operator, found `=>`
--> src/main.rs:6:17
|
6 | &Foo::B => "bart"
| ^^ expected one of 8 possible tokens here
As @mbrubeck pointed out in IRC, the cause is that a bitwise-and operation, namely "art" & Foo::B
is being parsed.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTCategory: An issue proposing an enhancement or a PR with one.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.Working group: Diagnostics