Skip to content

Commit

Permalink
replace current_opt with membership check
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Dec 8, 2016
1 parent 7ec9f8d commit addbb7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/cargo/ops/cargo_rustc/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
// we don't want to link it up.
if src_dir.ends_with("deps") {
// Don't lift up library dependencies
if self.ws.current_opt().map_or(false, |p| unit.pkg.package_id() != p.package_id())
&& !unit.target.is_bin() {
if self.ws.members().find(|&p| p != unit.pkg).is_some() && !unit.target.is_bin() {
None
} else {
Some((
Expand Down
4 changes: 1 addition & 3 deletions src/cargo/ops/cargo_rustc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,7 @@ fn build_base_args(cx: &mut Context,
let prefer_dynamic = (unit.target.for_host() &&
!unit.target.is_custom_build()) ||
(crate_types.contains(&"dylib") &&
cx.ws.current_opt().map_or(false, |p| {
*p.package_id() != *unit.pkg.package_id()
}));
cx.ws.members().find(|&p| p != unit.pkg).is_some());
if prefer_dynamic {
cmd.arg("-C").arg("prefer-dynamic");
}
Expand Down

0 comments on commit addbb7e

Please sign in to comment.