]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/control_flow_simplification.rs
Remove both StorageLive and StorageDead in CopyProp.
[rust.git] / tests / mir-opt / const_prop / control_flow_simplification.rs
1 // unit-test: ConstProp
2 // compile-flags: -Zmir-opt-level=1
3
4 trait NeedsDrop: Sized {
5     const NEEDS: bool = std::mem::needs_drop::<Self>();
6 }
7
8 impl<This> NeedsDrop for This {}
9
10 // EMIT_MIR control_flow_simplification.hello.ConstProp.diff
11 // EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir
12 fn hello<T>(){
13     if <bool>::NEEDS {
14         panic!()
15     }
16 }
17
18 pub fn main() {
19     hello::<()>();
20     hello::<Vec<()>>();
21 }