mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
24 lines
313 B
Rust
24 lines
313 B
Rust
// run-pass
|
|
#![allow(dead_code)]
|
|
|
|
enum Foo {
|
|
Bar,
|
|
Baz,
|
|
Boo,
|
|
}
|
|
|
|
static X: Foo = Foo::Bar;
|
|
|
|
pub fn main() {
|
|
match X {
|
|
Foo::Bar => {}
|
|
Foo::Baz | Foo::Boo => panic!()
|
|
}
|
|
match Y {
|
|
Foo::Baz => {}
|
|
Foo::Bar | Foo::Boo => panic!()
|
|
}
|
|
}
|
|
|
|
static Y: Foo = Foo::Baz;
|