1
Fork 0

Sort Eq candidates in the failure case too

This commit is contained in:
Nadrieril 2024-03-13 22:23:45 +01:00
parent 5ef9ad37ab
commit 75d2e67ed2
3 changed files with 44 additions and 51 deletions

View file

@ -650,12 +650,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}
}
// FIXME(#29623): return `Some(1)` when the values are different.
(TestKind::Eq { value: test_val, .. }, TestCase::Constant { value: case_val })
if test_val == case_val =>
{
fully_matched = true;
Some(TestBranch::Success)
(TestKind::Eq { value: test_val, .. }, TestCase::Constant { value: case_val }) => {
if test_val == case_val {
fully_matched = true;
Some(TestBranch::Success)
} else {
fully_matched = false;
Some(TestBranch::Failure)
}
}
(