Determine match_has_guard from candidates instead of looking up thir table again
This commit is contained in:
parent
f893495e3d
commit
2036aea18e
@ -170,7 +170,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
|
|
||||||
let mut arm_candidates = self.create_match_candidates(scrutinee_place.clone(), &arms);
|
let mut arm_candidates = self.create_match_candidates(scrutinee_place.clone(), &arms);
|
||||||
|
|
||||||
let match_has_guard = arms.iter().copied().any(|arm| self.thir[arm].guard.is_some());
|
let match_has_guard = arm_candidates.iter().any(|(_, candidate)| candidate.has_guard);
|
||||||
let mut candidates =
|
let mut candidates =
|
||||||
arm_candidates.iter_mut().map(|(_, candidate)| candidate).collect::<Vec<_>>();
|
arm_candidates.iter_mut().map(|(_, candidate)| candidate).collect::<Vec<_>>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user