2018-09-06 07:41:12 -05:00
|
|
|
// run-pass
|
2021-05-13 09:42:25 -05:00
|
|
|
// revisions: mirunsafeck thirunsafeck
|
|
|
|
// [thirunsafeck]compile-flags: -Z thir-unsafeck
|
2018-09-06 07:41:12 -05:00
|
|
|
|
2016-08-22 11:56:14 -05:00
|
|
|
union U {
|
|
|
|
a: u64,
|
|
|
|
b: u64,
|
|
|
|
}
|
|
|
|
|
|
|
|
const C: U = U { b: 10 };
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
let a = C.a;
|
|
|
|
let b = C.b;
|
|
|
|
assert_eq!(a, 10);
|
|
|
|
assert_eq!(b, 10);
|
|
|
|
}
|
|
|
|
}
|