Skip to content

Commit

Permalink
the more recently added conflicts are more likely to still be relevant
Browse files Browse the repository at this point in the history
This fixes most of the cases fount in rust-lang#6258, in practice if not in theory.
  • Loading branch information
Eh2406 committed Nov 7, 2018
1 parent a83cd61 commit d08fd37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cargo/core/resolver/conflict_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ pub(super) struct ConflictCache {
// unconditionally true regardless of our resolution history of how we got
// here.
con_from_dep: HashMap<Dependency, Vec<HashMap<PackageId, ConflictReason>>>,
// `past_conflict_triggers` is an
// of `past_conflicting_activations`.
// For every `PackageId` this lists the `Dependency`s that mention it in `past_conflicting_activations`.
// `dep_from_pid` is an inverse-index of `con_from_dep`.
// For every `PackageId` this lists the `Dependency`s that mention it in `dep_from_pid`.
dep_from_pid: HashMap<PackageId, HashSet<Dependency>>,
}

Expand All @@ -62,6 +61,7 @@ impl ConflictCache {
self.con_from_dep
.get(dep)?
.iter()
.rev() // more general cases are normally found letter. So start the search there.
.filter(filter)
.find(|conflicting| cx.is_conflicting(None, conflicting))
}
Expand Down

0 comments on commit d08fd37

Please sign in to comment.