1
Fork 0

Rollup merge of #108902 - lcnr:do-while-sus, r=davidtwco,Nilstrieb

no more do while :<
This commit is contained in:
Matthias Krüger 2023-03-10 21:15:46 +01:00 committed by GitHub
commit 5e449b32b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 25 deletions

View file

@ -588,8 +588,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
// let PATTERN = ... might not even exist until we do the assignment.
// so we set it here instead.
if set_match_place {
let mut candidate_ref = &candidate;
while let Some(next) = {
let mut next = Some(&candidate);
while let Some(candidate_ref) = next.take() {
for binding in &candidate_ref.bindings {
let local = self.var_local_id(binding.var_id, OutsideGuard);
// `try_to_place` may fail if it is unable to resolve the given
@ -617,9 +617,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}
// All of the subcandidates should bind the same locals, so we
// only visit the first one.
candidate_ref.subcandidates.get(0)
} {
candidate_ref = next;
next = candidate_ref.subcandidates.get(0)
}
}