fn find_candidate(
    cx: &Context,
    backtrack_stack: &mut Vec<BacktrackFrame>,
    parent: &Summary,
    backtracked: bool,
    conflicting_activations: &BTreeMap<PackageId, ConflictReason>
) -> Option<(Summary, bool, BacktrackFrame)>
Expand description

Looks through the states in backtrack_stack for dependencies with remaining candidates. For each one, also checks if rolling back could change the outcome of the failed resolution that caused backtracking in the first place. Namely, if we’ve backtracked past the parent of the failed dep, or any of the packages flagged as giving us trouble in conflicting_activations.

Read https://github.com/rust-lang/cargo/pull/4834 For several more detailed explanations of the logic here.