]>
Commit | Line | Data |
---|---|---|
f2b60f7d | 1 | // unit-test: ConstProp |
ba9703b0 XL |
2 | // compile-flags: -Zmir-opt-level=1 |
3 | ||
f2b60f7d FG |
4 | trait NeedsDrop: Sized { |
5 | const NEEDS: bool = std::mem::needs_drop::<Self>(); | |
ba9703b0 XL |
6 | } |
7 | ||
f2b60f7d | 8 | impl<This> NeedsDrop for This {} |
ba9703b0 | 9 | |
3dfed10e XL |
10 | // EMIT_MIR control_flow_simplification.hello.ConstProp.diff |
11 | // EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir | |
ba9703b0 XL |
12 | fn hello<T>(){ |
13 | if <bool>::NEEDS { | |
14 | panic!() | |
15 | } | |
16 | } | |
17 | ||
18 | pub fn main() { | |
19 | hello::<()>(); | |
20 | hello::<Vec<()>>(); | |
21 | } |