]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-const-codegen.rs
Rollup merge of #100462 - zohnannor:master, r=thomcc
[rust.git] / src / test / ui / union / union-const-codegen.rs
1 // run-pass
2 // revisions: mirunsafeck thirunsafeck
3 // [thirunsafeck]compile-flags: -Z thir-unsafeck
4
5 union U {
6     a: u64,
7     b: u64,
8 }
9
10 const C: U = U { b: 10 };
11
12 fn main() {
13     unsafe {
14         let a = C.a;
15         let b = C.b;
16         assert_eq!(a, 10);
17         assert_eq!(b, 10);
18      }
19 }