]>
git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/early_otherwise_branch_noopt.rs
1 // compile-flags: -Z mir-opt-level=3
3 // must not optimize as it does not follow the pattern of
4 // left and right hand side being the same variant
6 // EMIT_MIR early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
7 fn noopt1(x
: Option
<u32>, y
: Option
<u32>) -> u32 {
9 (Some(a
), Some(b
)) => 0,
16 // must not optimize as the types being matched on are not identical
17 // EMIT_MIR early_otherwise_branch_noopt.noopt2.EarlyOtherwiseBranch.diff
18 fn noopt2(x
: Option
<u32>, y
: Option
<bool
>) -> u32 {
20 (Some(a
), Some(b
)) => 0,
26 noopt1(None
, Some(0));
27 noopt2(None
, Some(true));