From 832b23ffcfae702c333915bf2c25493f9f62ebb5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 1 Mar 2024 19:07:08 +0100 Subject: [PATCH] Tiny missed simplification --- compiler/rustc_mir_build/src/build/matches/test.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs index 8ce7461747b..d811141f50f 100644 --- a/compiler/rustc_mir_build/src/build/matches/test.rs +++ b/compiler/rustc_mir_build/src/build/matches/test.rs @@ -603,17 +603,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }) } - (&TestKind::If, TestCase::Constant { value }) => { + (TestKind::If, TestCase::Constant { value }) => { fully_matched = true; let value = value.try_eval_bool(self.tcx, self.param_env).unwrap_or_else(|| { span_bug!(test.span, "expected boolean value but got {value:?}") }); Some(value as usize) } - (&TestKind::If, _) => { - fully_matched = false; - None - } ( &TestKind::Len { len: test_len, op: BinOp::Eq }, @@ -714,6 +710,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ( TestKind::Switch { .. } | TestKind::SwitchInt { .. } + | TestKind::If | TestKind::Len { .. } | TestKind::Range { .. } | TestKind::Eq { .. },