]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/dest-prop/union.rs
Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514
[rust.git] / src / test / mir-opt / dest-prop / union.rs
1 //! Tests that we can propogate into places that are projections into unions
2 // compile-flags: -Zunsound-mir-opts
3 fn val() -> u32 {
4     1
5 }
6
7 // EMIT_MIR union.main.DestinationPropagation.diff
8 fn main() {
9     union Un {
10         us: u32,
11     }
12
13     let un = Un { us: val() };
14
15     drop(unsafe { un.us });
16 }