]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/dest-prop/union.rs
Auto merge of #81047 - glittershark:stabilize-cmp-min-max-by, r=kodraus
[rust.git] / src / test / mir-opt / dest-prop / union.rs
1 //! Tests that projections through unions cancel `DestinationPropagation`.
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 }