Tiny missed simplification
This commit is contained in:
parent
5257aee7dd
commit
832b23ffcf
1 changed files with 2 additions and 5 deletions
|
@ -603,17 +603,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
(&TestKind::If, TestCase::Constant { value }) => {
|
(TestKind::If, TestCase::Constant { value }) => {
|
||||||
fully_matched = true;
|
fully_matched = true;
|
||||||
let value = value.try_eval_bool(self.tcx, self.param_env).unwrap_or_else(|| {
|
let value = value.try_eval_bool(self.tcx, self.param_env).unwrap_or_else(|| {
|
||||||
span_bug!(test.span, "expected boolean value but got {value:?}")
|
span_bug!(test.span, "expected boolean value but got {value:?}")
|
||||||
});
|
});
|
||||||
Some(value as usize)
|
Some(value as usize)
|
||||||
}
|
}
|
||||||
(&TestKind::If, _) => {
|
|
||||||
fully_matched = false;
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
(
|
(
|
||||||
&TestKind::Len { len: test_len, op: BinOp::Eq },
|
&TestKind::Len { len: test_len, op: BinOp::Eq },
|
||||||
|
@ -714,6 +710,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
(
|
(
|
||||||
TestKind::Switch { .. }
|
TestKind::Switch { .. }
|
||||||
| TestKind::SwitchInt { .. }
|
| TestKind::SwitchInt { .. }
|
||||||
|
| TestKind::If
|
||||||
| TestKind::Len { .. }
|
| TestKind::Len { .. }
|
||||||
| TestKind::Range { .. }
|
| TestKind::Range { .. }
|
||||||
| TestKind::Eq { .. },
|
| TestKind::Eq { .. },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue