summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-enum-structlike.rs
blob: 0ea79aebce61f76a9adccc3fa39037b26ba8ace4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
#![allow(dead_code)]

enum E {
    S0 { s: String },
    S1 { u: usize }
}

static C: E = E::S1 { u: 23 };

pub fn main() {
    match C {
        E::S0 { .. } => panic!(),
        E::S1 { u } => assert_eq!(u, 23)
    }
}