summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-enum-struct.rs
blob: ee88c936188be34b1ff36fd7c9a9f362cdb4debf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass
#![allow(dead_code)]

enum E { V16(u16), V32(u32) }
struct S { a: E, b: u16, c: u16 }
static C: S = S { a: E::V16(0xDEAD), b: 0x600D, c: 0xBAD };

pub fn main() {
    let n = C.b;
    assert!(n != 0xBAD);
    assert_eq!(n, 0x600D);
}