]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-nullary-enum.rs
Rollup merge of #106962 - compiler-errors:use-sugg-span, r=oli-obk
[rust.git] / tests / ui / consts / const-nullary-enum.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 enum Foo {
5     Bar,
6     Baz,
7     Boo,
8 }
9
10 static X: Foo = Foo::Bar;
11
12 pub fn main() {
13     match X {
14         Foo::Bar => {}
15         Foo::Baz | Foo::Boo => panic!()
16     }
17     match Y {
18         Foo::Baz => {}
19         Foo::Bar | Foo::Boo => panic!()
20     }
21 }
22
23 static Y: Foo = Foo::Baz;