mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
Tiny missed simplification
This commit is contained in:
parent
5257aee7dd
commit
832b23ffcf
@ -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 { .. },
|
||||
|
Loading…
Reference in New Issue
Block a user