let deps = cx.build_deps(registry, parent, &candidate, method)?;
let frame = DepsFrame {
parent: candidate,
+ just_for_error_messages: false,
remaining_siblings: RcVecIter::new(Rc::new(deps)),
};
Ok(Some((frame, now.elapsed())))
#[derive(Clone)]
struct DepsFrame {
parent: Summary,
+ just_for_error_messages: bool,
remaining_siblings: RcVecIter<DepInfo>,
}
impl PartialEq for DepsFrame {
fn eq(&self, other: &DepsFrame) -> bool {
+ self.just_for_error_messages == other.just_for_error_messages &&
self.min_candidates() == other.min_candidates()
}
}
impl Ord for DepsFrame {
fn cmp(&self, other: &DepsFrame) -> Ordering {
- // the frame with the sibling that has the least number of candidates
- // needs to get the bubbled up to the top of the heap we use below, so
- // reverse the order of the comparison here.
- other.min_candidates().cmp(&self.min_candidates())
+ self.just_for_error_messages.cmp(&other.just_for_error_messages).then_with(||
+ // the frame with the sibling that has the least number of candidates
+ // needs to get bubbled up to the top of the heap we use below, so
+ // reverse comparison here.
+ self.min_candidates().cmp(&other.min_candidates()).reverse()
+ )
}
}
successfully_activated = res.is_ok();
match res {
- Ok(Some((frame, dur))) => {
+ Ok(Some((mut frame, dur))) => {
let mut has_past_conflicting_dep = just_here_for_the_error_messages && !backtracked;
if !has_past_conflicting_dep {
if let Some(conflicting) = frame.remaining_siblings.clone().filter_map(|(_, (deb, _, _))| {
}
}
// 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 {
trace!("{}[{}]>{} skipping {} ", parent.name(), cur, dep.name(), pid.version());
successfully_activated = false;