rust/tests/ui/consts/const-nullary-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
314 B
Rust
Raw Normal View History

//@ 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;