about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-14 23:29:55 +0200
committerGitHub <noreply@github.com>2020-04-14 23:29:55 +0200
commit119e32bca17873c018faf4e0351819311f84aafb (patch)
tree7a92b05cd5e2506f47b8d10b199106d09ced8a9a
parente2f24230a23cb6074c26a6a4b6546cb10740fb84 (diff)
parent54b5d30f2981736156e75d49e39632875dad5f73 (diff)
downloadrust-119e32bca17873c018faf4e0351819311f84aafb.tar.gz
rust-119e32bca17873c018faf4e0351819311f84aafb.zip
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`
-rw-r--r--src/librustdoc/test.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs
index 7841d5eef58..fbbe172afb8 100644
--- a/src/librustdoc/test.rs
+++ b/src/librustdoc/test.rs
@@ -263,7 +263,12 @@ fn run_test(
     if no_run && !compile_fail {
         compiler.arg("--emit=metadata");
     }
-    compiler.arg("--target").arg(target.to_string());
+    compiler.arg("--target").arg(match target {
+        TargetTriple::TargetTriple(s) => s,
+        TargetTriple::TargetPath(path) => {
+            path.to_str().expect("target path must be valid unicode").to_string()
+        }
+    });
 
     compiler.arg("-");
     compiler.stdin(Stdio::piped());
@@ -312,8 +317,8 @@ fn run_test(
 
     if let Some(tool) = runtool {
         cmd = Command::new(tool);
-        cmd.arg(output_file);
         cmd.args(runtool_args);
+        cmd.arg(output_file);
     } else {
         cmd = Command::new(output_file);
     }