mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
20 lines
347 B
Rust
20 lines
347 B
Rust
enum Foo {
|
|
Bar(i32),
|
|
Baz
|
|
}
|
|
|
|
struct S;
|
|
|
|
fn main() {
|
|
match Foo::Baz {
|
|
Foo::Bar => {}
|
|
//~^ ERROR expected unit struct, unit variant or constant, found tuple variant `Foo::Bar`
|
|
_ => {}
|
|
}
|
|
|
|
match S {
|
|
S(()) => {}
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit struct `S`
|
|
}
|
|
}
|