]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/discriminant.rs
Rollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc
[rust.git] / src / test / mir-opt / const_prop / discriminant.rs
1 // compile-flags: -O
2
3 // FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
4 // `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
5 // and `InterpCx::eval_place()` always forces an allocation which creates the `Indirect`.
6 // Fixing either of those will allow us to const-prop this away.
7
8 // EMIT_MIR_FOR_EACH_BIT_WIDTH
9 // EMIT_MIR discriminant.main.ConstProp.diff
10 fn main() {
11     let x = (if let Some(true) = Some(true) { 42 } else { 10 }) + 0;
12 }