rust/tests/ui/union/union-const-eval.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
251 B
Rust
Raw Normal View History

2021-06-03 07:31:27 +00:00
// check-pass
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
union U {
a: usize,
b: usize,
}
const C: U = U { a: 10 };
fn main() {
2018-01-16 08:24:38 +00:00
let a: [u8; unsafe { C.a }];
let b: [u8; unsafe { C.b }];
}