-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-parserparser issuesparser issuesC-bugCategory: bugCategory: bugS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
rust-analyzer version: 0.3.1178-standalone (latest)
rustc version: 1.60.0
#[derive(Debug)]
enum KeyCode {
Up,
Down,
Left,
}
fn main() {
foo(KeyCode::Up);
}
fn foo(x: KeyCode) {
if let (a @ ( KeyCode::Up | KeyCode::Down),) = (x,) {
println!("{:?}", a);
}
}
fn bar(x: KeyCode) {
if let (a @ (| KeyCode::Up | KeyCode::Down),) = (x,) {
// ^ Syntax Error: expected a pattern rust-analyzer
println!("{:?}", a);
}
}
Actual: Syntax Error at leading |
in fn bar
Expected: No Syntax Error (see rust spec)
EDIT: looks like this is a duplicate of #12894
Metadata
Metadata
Assignees
Labels
A-parserparser issuesparser issuesC-bugCategory: bugCategory: bugS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now