Skip to content

Commit dd9ff1f

Browse files
committed
When test backtracking include conflicts in remaining_candidates
1 parent f5a0f28 commit dd9ff1f

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/cargo/core/resolver/mod.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,9 @@ fn activate_deps_loop(
10851085
if let Some(conflicting) = frame
10861086
.remaining_siblings
10871087
.clone()
1088-
.filter_map(|(_, (new_dep, _, _))| past_conflicting_activations.get(&new_dep))
1088+
.filter_map(|(_, (new_dep, _, _))| {
1089+
past_conflicting_activations.get(&new_dep)
1090+
})
10891091
.flat_map(|x| x)
10901092
.find(|con| cx.is_conflicting(None, con))
10911093
{
@@ -1098,14 +1100,15 @@ fn activate_deps_loop(
10981100
// if not has_another we we activate for the better error messages
10991101
frame.just_for_error_messages = has_past_conflicting_dep;
11001102
if !has_past_conflicting_dep
1101-
|| (!has_another
1102-
&& (just_here_for_the_error_messages
1103-
|| find_candidate(
1104-
&mut backtrack_stack.clone(),
1105-
&parent,
1106-
&conflicting_activations,
1107-
).is_none()))
1108-
{
1103+
|| (!has_another && (just_here_for_the_error_messages || {
1104+
conflicting_activations
1105+
.extend(remaining_candidates.conflicting_prev_active.clone());
1106+
find_candidate(
1107+
&mut backtrack_stack.clone(),
1108+
&parent,
1109+
&conflicting_activations,
1110+
).is_none()
1111+
})) {
11091112
remaining_deps.push(frame);
11101113
} else {
11111114
trace!(
@@ -1618,7 +1621,10 @@ impl Context {
16181621
parent: Option<&PackageId>,
16191622
conflicting_activations: &HashMap<PackageId, ConflictReason>,
16201623
) -> bool {
1621-
conflicting_activations.keys().chain(parent).all(|id| self.is_active(id))
1624+
conflicting_activations
1625+
.keys()
1626+
.chain(parent)
1627+
.all(|id| self.is_active(id))
16221628
}
16231629

16241630
/// Return all dependencies and the features we want from them.

0 commit comments

Comments
 (0)