Skip to content

Commit

Permalink
Don't panic on a non-fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrrho committed Sep 26, 2019
1 parent e2010e8 commit f7bfd9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cargo/core/resolver/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::util::Graph;

use super::dep_cache::RegistryQueryer;
use super::errors::ActivateResult;
use super::types::{ConflictMap, FeaturesSet, ResolveOpts};
use super::types::{ConflictMap, ConflictReason, FeaturesSet, ResolveOpts};

pub use super::encode::Metadata;
pub use super::encode::{EncodableDependency, EncodablePackageId, EncodableResolve};
Expand Down Expand Up @@ -151,7 +151,11 @@ impl Context {
if dep.source_id() != id.source_id() {
let key = (id.name(), dep.source_id(), id.version().into());
let prev = self.activations.insert(key, (summary.clone(), age));
assert!(prev.is_none());
if let Some((previous_summary, _)) = prev {
return Err(
(previous_summary.package_id(), ConflictReason::Semver).into()
);
}
}
}

Expand Down

0 comments on commit f7bfd9d

Please sign in to comment.