]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/const_prop/control-flow-simplification.rs
New upstream version 1.44.1+dfsg1
[rustc.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 rustc.hello.ConstProp.diff
10 // EMIT_MIR rustc.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 }