rust/src/test/ui/union/union-const-eval.rs

18 lines
317 B
Rust
Raw Normal View History

// build-pass (FIXME(62277): could be check-pass?)
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
#![feature(const_fn_union)]
2018-01-16 08:24:38 +00:00
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 }];
}