Skip to content

Commit 1f0d328

Browse files
committed
Pass --target down to rustdoc if specified with host target
1 parent c85a71e commit 1f0d328

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/ops/cargo_test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ fn run_doc_tests(
200200
p.arg(unit.target.src_path().path().unwrap());
201201
}
202202

203+
if let CompileKind::Target(target) = unit.kind {
204+
// use `rustc_target()` to properly handle JSON target paths
205+
p.arg("--target").arg(target.rustc_target());
206+
}
207+
203208
if doctest_xcompile {
204-
if let CompileKind::Target(target) = unit.kind {
205-
// use `rustc_target()` to properly handle JSON target paths
206-
p.arg("--target").arg(target.rustc_target());
207-
}
208209
p.arg("-Zunstable-options");
209210
p.arg("--enable-per-target-ignores");
210211
if let Some((runtool, runtool_args)) = compilation.target_runner(unit.kind) {

0 commit comments

Comments
 (0)