mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
23 lines
314 B
Rust
23 lines
314 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;
|