Skip to content

Commit

Permalink
maybe something like this?
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Feb 26, 2020
1 parent a07fec1 commit d3f712a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/cargo/core/resolver/dep_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use crate::core::interning::InternedString;
use crate::core::{Dependency, FeatureValue, PackageId, PackageIdSpec, Registry, Summary};
use crate::util::errors::{CargoResult, CargoResultExt};

use crate::core::resolver::context::Context;
use crate::core::resolver::errors::describe_path;
use crate::core::resolver::types::{ConflictReason, DepInfo, FeaturesSet};
use crate::core::resolver::{ActivateResult, ResolveOpts};

Expand Down Expand Up @@ -197,6 +199,7 @@ impl<'a> RegistryQueryer<'a> {
/// next obvious question.
pub fn build_deps(
&mut self,
cx: &Context,
parent: Option<PackageId>,
candidate: &Summary,
opts: &ResolveOpts,
Expand All @@ -222,9 +225,10 @@ impl<'a> RegistryQueryer<'a> {
.map(|(dep, features)| {
let candidates = self.query(&dep).chain_err(|| {
anyhow::format_err!(
"failed to get `{}` as a dependency of `{}`",
"failed to get `{}` as a dependency of `{}` ... {}",
dep.package_name(),
candidate.package_id(),
&describe_path(&cx.parents.path_to_bottom(&candidate.package_id())),
)
})?;
Ok((dep, candidates, features))
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ fn activate(

let now = Instant::now();
let (used_features, deps) =
&*registry.build_deps(parent.map(|p| p.0.package_id()), &candidate, &opts)?;
&*registry.build_deps(&*cx, parent.map(|p| p.0.package_id()), &candidate, &opts)?;

// Record what list of features is active for this package.
if !used_features.is_empty() {
Expand Down

0 comments on commit d3f712a

Please sign in to comment.