2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: GVN
|
2024-02-22 06:10:29 -06:00
|
|
|
//@ compile-flags: -O
|
2024-01-26 03:30:46 -06:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
|
|
|
// skip-filecheck
|
|
|
|
|
|
|
|
#![feature(never_type)]
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
pub enum E {
|
|
|
|
A(!, u32),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub union U {
|
|
|
|
i: u32,
|
|
|
|
e: E,
|
|
|
|
}
|
|
|
|
|
|
|
|
// EMIT_MIR gvn_uninhabited.f.GVN.diff
|
|
|
|
pub const fn f() -> u32 {
|
|
|
|
let E::A(_, i) = unsafe { (&U { i: 0 }).e };
|
|
|
|
i
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|