From: Phaiax Date: Sun, 25 Sep 2016 12:10:01 +0000 (+0200) Subject: Fix #3107. rustdoc without --target if compiled for host X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~13^2~22^2~1^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=949f6a51febcc600f549da91f7be41094362d305;p=cargo.git Fix #3107. rustdoc without --target if compiled for host --- diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index b36ed3ceb..d6ba15480 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -402,8 +402,10 @@ fn rustdoc(cx: &mut Context, unit: &Unit) -> CargoResult { .cwd(cx.config.cwd()) .arg("--crate-name").arg(&unit.target.crate_name()); - if let Some(target) = cx.requested_target() { - rustdoc.arg("--target").arg(target); + if unit.kind != Kind::Host { + if let Some(target) = cx.requested_target() { + rustdoc.arg("--target").arg(target); + } } let doc_dir = cx.out_dir(unit);