Skip to content

Commit

Permalink
and links just to be throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Mar 6, 2018
1 parent aa58d27 commit ad26b89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ struct Context {
// make these much cheaper to clone in general.
activations: Activations,
resolve_features: HashMap<PackageId, HashSet<InternedString>>,
links: HashMap<String, PackageId>,
links: HashMap<InternedString, PackageId>,

// These are two cheaply-cloneable lists (O(1) clone) which are effectively
// hash maps but are built up as "construction lists". We'll iterate these
Expand Down Expand Up @@ -706,7 +706,7 @@ impl RemainingCandidates {
fn next(
&mut self,
prev_active: &[Summary],
links: &HashMap<String, PackageId>,
links: &HashMap<InternedString, PackageId>,
) -> Result<(Candidate, bool), HashMap<PackageId, ConflictReason>> {
// Filter the set of candidates based on the previously activated
// versions for this dependency. We can actually use a version if it
Expand All @@ -723,7 +723,7 @@ impl RemainingCandidates {
use std::mem::replace;
for (_, b) in self.remaining.by_ref() {
if let Some(link) = b.summary.links() {
if let Some(a) = links.get(link) {
if let Some(a) = links.get(&InternedString::new(link)) {
if a != b.summary.package_id() {
self.conflicting_prev_active
.entry(a.clone())
Expand Down Expand Up @@ -1298,7 +1298,7 @@ impl Context {
if !prev.iter().any(|c| c == summary) {
self.resolve_graph.push(GraphNode::Add(id.clone()));
if let Some(link) = summary.links() {
ensure!(self.links.insert(link.to_owned(), id.clone()).is_none(),
ensure!(self.links.insert(InternedString::new(link), id.clone()).is_none(),
"Attempting to resolve a with more then one crate with the links={}. \n\
This will not build as is. Consider rebuilding the .lock file.", link);
}
Expand Down

0 comments on commit ad26b89

Please sign in to comment.