From: Eh2406 Date: Sat, 17 Mar 2018 01:40:13 +0000 (-0400) Subject: When test backtracking include conflicts in `remaining_candidates` X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~31^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dd9ff1f23040e7994129e318ed02b194151f0265;p=cargo.git When test backtracking include conflicts in `remaining_candidates` --- diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs index fe9a8c85d..13054aa4f 100644 --- a/src/cargo/core/resolver/mod.rs +++ b/src/cargo/core/resolver/mod.rs @@ -1085,7 +1085,9 @@ fn activate_deps_loop( if let Some(conflicting) = frame .remaining_siblings .clone() - .filter_map(|(_, (new_dep, _, _))| past_conflicting_activations.get(&new_dep)) + .filter_map(|(_, (new_dep, _, _))| { + past_conflicting_activations.get(&new_dep) + }) .flat_map(|x| x) .find(|con| cx.is_conflicting(None, con)) { @@ -1098,14 +1100,15 @@ fn activate_deps_loop( // if not has_another we we activate for the better error messages frame.just_for_error_messages = has_past_conflicting_dep; if !has_past_conflicting_dep - || (!has_another - && (just_here_for_the_error_messages - || find_candidate( - &mut backtrack_stack.clone(), - &parent, - &conflicting_activations, - ).is_none())) - { + || (!has_another && (just_here_for_the_error_messages || { + conflicting_activations + .extend(remaining_candidates.conflicting_prev_active.clone()); + find_candidate( + &mut backtrack_stack.clone(), + &parent, + &conflicting_activations, + ).is_none() + })) { remaining_deps.push(frame); } else { trace!( @@ -1618,7 +1621,10 @@ impl Context { parent: Option<&PackageId>, conflicting_activations: &HashMap, ) -> bool { - conflicting_activations.keys().chain(parent).all(|id| self.is_active(id)) + conflicting_activations + .keys() + .chain(parent) + .all(|id| self.is_active(id)) } /// Return all dependencies and the features we want from them.