]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/remove_zsts_dont_touch_unions.rs
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
[rust.git] / src / test / mir-opt / remove_zsts_dont_touch_unions.rs
1 // unit-test: RemoveZsts
2
3 // Ensure RemoveZsts doesn't remove ZST assignments to union fields,
4 // which causes problems in Miri.
5
6 union Foo {
7     x: (),
8     y: u64,
9 }
10
11 // EMIT_MIR remove_zsts_dont_touch_unions.get_union.RemoveZsts.after.mir
12 fn get_union() -> Foo {
13     Foo { x: () }
14 }
15
16
17 fn main() {
18     get_union();
19 }