]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/control-flow-simplification.rs
Rollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc
[rust.git] / src / test / mir-opt / const_prop / control-flow-simplification.rs
1 // compile-flags: -Zmir-opt-level=1
2
3 trait NeedsDrop:Sized{
4     const NEEDS:bool=std::mem::needs_drop::<Self>();
5 }
6
7 impl<This> NeedsDrop for This{}
8
9 // EMIT_MIR control_flow_simplification.hello.ConstProp.diff
10 // EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir
11 fn hello<T>(){
12     if <bool>::NEEDS {
13         panic!()
14     }
15 }
16
17 pub fn main() {
18     hello::<()>();
19     hello::<Vec<()>>();
20 }