blob: 640579a3ebeca28e050a7e18cc4fc95225fe5321 [file]
// 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.runtime-optimized.after.mir
fn hello<T>() {
// CHECK-LABEL: fn hello(
// CHECK: bb0:
// CHECK-NEXT: return;
if <bool>::NEEDS {
panic!()
}
}
pub fn main() {
hello::<()>();
hello::<Vec<()>>();
}