Skip to content

Commit

Permalink
error when we can't actually link to a crate
Browse files Browse the repository at this point in the history
  • Loading branch information
froydnj committed Oct 7, 2016
1 parent d3bad1a commit 3b6c255
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cargo/ops/cargo_rustc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,15 @@ fn build_deps_args(cmd: &mut CommandPrototype, cx: &Context, unit: &Unit)
cmd.env("OUT_DIR", &layout.build_out(unit.pkg));
}

for unit in try!(cx.dep_targets(unit)).iter() {
if unit.target.linkable() && !unit.profile.doc {
try!(link_to(cmd, cx, unit));
for dep in try!(cx.dep_targets(unit)).iter() {
if !dep.profile.doc {
if dep.target.linkable() {
try!(link_to(cmd, cx, dep));
} else {
return Err(human(format!("Crate {} cannot be linked into {}",
dep.target.crate_name(),
unit.target.crate_name())))
}
}
}

Expand Down

0 comments on commit 3b6c255

Please sign in to comment.