From: Eh2406 Date: Tue, 13 Mar 2018 15:54:21 +0000 (-0400) Subject: Only activate for the better error messages if we will bactrack to the user X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~46^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=290a21017551f640df83e928e95fe11574445502;p=cargo.git Only activate for the better error messages if we will bactrack to the user --- diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs index 06addad85..76fd86ae6 100644 --- a/src/cargo/core/resolver/mod.rs +++ b/src/cargo/core/resolver/mod.rs @@ -899,10 +899,12 @@ fn activate_deps_loop( // to activate that one. trace!("{}[{}]>{} -- no candidates", parent.name(), cur, dep.name()); - let past = past_conflicting_activations.entry(dep.clone()).or_insert_with(Vec::new); - if !just_here_for_the_error_messages && !past.contains(&conflicting_activations) { - trace!("{}[{}]>{} adding a skip {:?}", parent.name(), cur, dep.name(), conflicting_activations); - past.push(conflicting_activations.clone()); + if !just_here_for_the_error_messages && !backtracked { + let past = past_conflicting_activations.entry(dep.clone()).or_insert_with(Vec::new); + if !past.contains(&conflicting_activations) { + trace!("{}[{}]>{} adding a skip {:?}", parent.name(), cur, dep.name(), conflicting_activations); + past.push(conflicting_activations.clone()); + } } find_candidate( @@ -997,11 +999,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 { + if !has_past_conflicting_dep || (!has_another && (just_here_for_the_error_messages || find_candidate( + &mut backtrack_stack.clone(), + &parent, + &conflicting_activations, + ).is_none())) { + remaining_deps.push(frame); + } else { trace!("{}[{}]>{} skipping {} ", parent.name(), cur, dep.name(), pid.version()); successfully_activated = false; - } else { - remaining_deps.push(frame); } deps_time += dur; }