mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
16 lines
431 B
Rust
16 lines
431 B
Rust
enum Enum {
|
|
Foo { a: usize, b: usize },
|
|
Bar(usize, usize),
|
|
}
|
|
|
|
fn main() {
|
|
let x = Enum::Foo(a: 3, b: 4);
|
|
//~^ ERROR invalid `struct` delimiters or `fn` call arguments
|
|
match x {
|
|
Enum::Foo(a, b) => {}
|
|
//~^ ERROR expected tuple struct or tuple variant, found struct variant `Enum::Foo`
|
|
Enum::Bar { a, b } => {}
|
|
//~^ ERROR tuple variant `Enum::Bar` written as struct variant
|
|
}
|
|
}
|