2023-10-16 17:36:39 +00:00
|
|
|
// skip-filecheck
|
2023-06-08 07:18:34 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-20 11:19:34 +00:00
|
|
|
//@ test-mir-pass: GVN
|
2020-03-22 02:37:51 +00:00
|
|
|
//@ compile-flags: -Zmir-opt-level=1
|
|
|
|
|
2022-07-26 17:04:27 +00:00
|
|
|
trait NeedsDrop: Sized {
|
|
|
|
const NEEDS: bool = std::mem::needs_drop::<Self>();
|
2020-03-22 02:37:51 +00:00
|
|
|
}
|
|
|
|
|
2022-07-26 17:04:27 +00:00
|
|
|
impl<This> NeedsDrop for This {}
|
2020-03-22 02:37:51 +00:00
|
|
|
|
2023-09-20 21:43:33 +00:00
|
|
|
// EMIT_MIR control_flow_simplification.hello.GVN.diff
|
2020-07-27 19:22:43 +00:00
|
|
|
// EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir
|
2024-06-03 00:18:33 +00:00
|
|
|
fn hello<T>() {
|
2020-03-22 02:37:51 +00:00
|
|
|
if <bool>::NEEDS {
|
|
|
|
panic!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
hello::<()>();
|
|
|
|
hello::<Vec<()>>();
|
|
|
|
}
|