Skip to content

Commit 119e32b

Browse files
authored
Rollup merge of #71002 - Freax13:fix-target, r=ollie27
fix target & runtool args order - `TargetTripple::to_string` converts "path triples" to `<target>-<hash>`, but in this case we need the path. Afaict there is no method to get the real triple other than manually matching - the order of the runtools arguments is inconsistent with the way tests usually pass arguments ie using `runner` key in `.cargo/config`
2 parents e2f2423 + 54b5d30 commit 119e32b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustdoc/test.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ fn run_test(
263263
if no_run && !compile_fail {
264264
compiler.arg("--emit=metadata");
265265
}
266-
compiler.arg("--target").arg(target.to_string());
266+
compiler.arg("--target").arg(match target {
267+
TargetTriple::TargetTriple(s) => s,
268+
TargetTriple::TargetPath(path) => {
269+
path.to_str().expect("target path must be valid unicode").to_string()
270+
}
271+
});
267272

268273
compiler.arg("-");
269274
compiler.stdin(Stdio::piped());
@@ -312,8 +317,8 @@ fn run_test(
312317

313318
if let Some(tool) = runtool {
314319
cmd = Command::new(tool);
315-
cmd.arg(output_file);
316320
cmd.args(runtool_args);
321+
cmd.arg(output_file);
317322
} else {
318323
cmd = Command::new(output_file);
319324
}

0 commit comments

Comments
 (0)