Skip to content

Commit

Permalink
Store unit dependencies directly into Context
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed May 2, 2018
1 parent 42e9412 commit d02c726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
None => None,
};

let deps = build_unit_dependencies(units, self.bcx)?;
self.unit_dependencies = deps;
build_unit_dependencies(units, self.bcx, &mut self.unit_dependencies)?;
let files = CompilationFiles::new(
units,
host_layout,
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/core/compiler/context/unit_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use CargoResult;
pub fn build_unit_dependencies<'a, 'cfg>(
roots: &[Unit<'a>],
bcx: &BuildContext<'a, 'cfg>,
) -> CargoResult<HashMap<Unit<'a>, Vec<Unit<'a>>>> {
let mut deps = HashMap::new();
mut deps: &mut HashMap<Unit<'a>, Vec<Unit<'a>>>,
) -> CargoResult<()> {
for unit in roots.iter() {
// Dependencies of tests/benches should not have `panic` set.
// We check the global test mode to see if we are running in `cargo
Expand All @@ -43,7 +43,7 @@ pub fn build_unit_dependencies<'a, 'cfg>(
deps_of(unit, bcx, &mut deps, profile_for)?;
}

Ok(deps)
Ok(())
}

fn deps_of<'a, 'b, 'cfg>(
Expand Down

0 comments on commit d02c726

Please sign in to comment.