summary refs log tree commit diff
path: root/src/test/ui/union/union-const-eval.rs
blob: 0b6788b4226ab9d1f9b6fa3829b11c7eca336fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// build-pass (FIXME(62277): could be check-pass?)
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck

#![feature(const_fn_union)]

union U {
    a: usize,
    b: usize,
}

const C: U = U { a: 10 };

fn main() {
    let a: [u8; unsafe { C.a }];
    let b: [u8; unsafe { C.b }];
}