Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify backtrack #15150

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,6 @@ fn find_candidate(
};

while let Some(mut frame) = backtrack_stack.pop() {
let next = frame
.remaining_candidates
.next(&mut frame.conflicting_activations, &frame.context);
let Some((candidate, has_another)) = next else {
continue;
};

// If all members of `conflicting_activations` are still
// active in this back up we know that we're guaranteed to not actually
// make any progress. As a result if we hit this condition we can
Expand Down Expand Up @@ -999,6 +992,11 @@ fn find_candidate(
}
}

let (candidate, has_another) = frame
epage marked this conversation as resolved.
Show resolved Hide resolved
.remaining_candidates
.next(&mut frame.conflicting_activations, &frame.context)
.expect("why did we save a frame that has no next?");

return Some((candidate, has_another, frame));
}
None
Expand Down