mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
19 lines
359 B
Rust
19 lines
359 B
Rust
// skip-filecheck
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
|
//! Tests that we can propagate into places that are projections into unions
|
|
// compile-flags: -Zunsound-mir-opts
|
|
fn val() -> u32 {
|
|
1
|
|
}
|
|
|
|
// EMIT_MIR union.main.DestinationPropagation.diff
|
|
fn main() {
|
|
union Un {
|
|
us: u32,
|
|
}
|
|
|
|
let un = Un { us: val() };
|
|
|
|
drop(unsafe { un.us });
|
|
}
|