summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/remove_zsts_dont_touch_unions.rs
blob: 8b9de9b4d65a66fd987f2357d44fc0cecf038e42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// unit-test: RemoveZsts

// Ensure RemoveZsts doesn't remove ZST assignments to union fields,
// which causes problems in Miri.

union Foo {
    x: (),
    y: u64,
}

// EMIT_MIR remove_zsts_dont_touch_unions.get_union.RemoveZsts.after.mir
fn get_union() -> Foo {
    Foo { x: () }
}


fn main() {
    get_union();
}