blob: 8ec630d6f48d0c90a0657c31c3c759d95830910f [file] [log] [blame]
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: GVN
//@ compile-flags: -Zmir-opt-level=1
trait NeedsDrop: Sized {
const NEEDS: bool = std::mem::needs_drop::<Self>();
}
impl<This> NeedsDrop for This {}
// EMIT_MIR control_flow_simplification.hello.GVN.diff
// EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir
fn hello<T>() {
// CHECK-LABEL: fn hello(
// CHECK: bb0:
// CHECK-NEXT: return;
if <bool>::NEEDS {
panic!()
}
}
pub fn main() {
hello::<()>();
hello::<Vec<()>>();
}