Skip to content

Commit c2564d0

Browse files
committed
Tiny missed simplification
1 parent 22b8a7d commit c2564d0

File tree

1 file changed

+2
-5
lines changed
  • compiler/rustc_mir_build/src/build/matches

1 file changed

+2
-5
lines changed

compiler/rustc_mir_build/src/build/matches/test.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,17 +603,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
603603
})
604604
}
605605

606-
(&TestKind::If, TestCase::Constant { value }) => {
606+
(TestKind::If, TestCase::Constant { value }) => {
607607
fully_matched = true;
608608
let value = value.try_eval_bool(self.tcx, self.param_env).unwrap_or_else(|| {
609609
span_bug!(test.span, "expected boolean value but got {value:?}")
610610
});
611611
Some(value as usize)
612612
}
613-
(&TestKind::If, _) => {
614-
fully_matched = false;
615-
None
616-
}
617613

618614
(
619615
&TestKind::Len { len: test_len, op: BinOp::Eq },
@@ -714,6 +710,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
714710
(
715711
TestKind::Switch { .. }
716712
| TestKind::SwitchInt { .. }
713+
| TestKind::If
717714
| TestKind::Len { .. }
718715
| TestKind::Range { .. }
719716
| TestKind::Eq { .. },

0 commit comments

Comments
 (0)