summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-nullary-enum.rs
blob: b6574dce6ca0f9e64da3b236a08dd9768f6a7b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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;