1 // unit-test: MatchBranchSimplification
3 // EMIT_MIR_FOR_EACH_BIT_WIDTH
4 // EMIT_MIR matches_reduce_branches.foo.MatchBranchSimplification.diff
5 // EMIT_MIR matches_reduce_branches.bar.MatchBranchSimplification.diff
6 // EMIT_MIR matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
8 fn foo(bar: Option<()>) {
9 if matches!(bar, None) {
14 fn bar(i: i32) -> (bool, bool, bool, bool) {
40 fn match_nested_if() -> bool {
42 () if if if if true { true } else { false } { true } else { false } {
57 let _ = foo(Some(()));
59 let _ = match_nested_if();