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