Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
437 B
Rust
Raw Normal View History

// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we can propagate into places that are projections into unions
//@ compile-flags: -Zunsound-mir-opts -C debuginfo=full
2020-05-24 21:37:09 +02:00
fn val() -> u32 {
1
}
2020-09-12 15:10:51 +02:00
// EMIT_MIR union.main.DestinationPropagation.diff
2020-05-24 21:37:09 +02:00
fn main() {
// CHECK-LABEL: fn main(
2024-06-26 19:39:37 +02:00
// CHECK: {{_.*}} = Un { us: const 1_u32 };
2020-05-24 21:37:09 +02:00
union Un {
us: u32,
}
let un = Un { us: val() };
drop(unsafe { un.us });
}