]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-enum-struct.rs
Rollup merge of #107004 - compiler-errors:new-solver-new-candidates-2, r=lcnr
[rust.git] / tests / ui / consts / const-enum-struct.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 enum E { V16(u16), V32(u32) }
5 struct S { a: E, b: u16, c: u16 }
6 static C: S = S { a: E::V16(0xDEAD), b: 0x600D, c: 0xBAD };
7
8 pub fn main() {
9     let n = C.b;
10     assert!(n != 0xBAD);
11     assert_eq!(n, 0x600D);
12 }