about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-05-04 11:24:58 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-05-04 11:24:58 +0000
commit7905fa92ce86167625d5b87c402bc0cef9497124 (patch)
tree37649405d12f0f64e2a117d7c5f5cb56e9144990
parentedd0e5df3b4f9d291f045e869f7e67e7ded8a94f (diff)
downloadrust-7905fa92ce86167625d5b87c402bc0cef9497124.tar.gz
rust-7905fa92ce86167625d5b87c402bc0cef9497124.zip
Fix rustc test suite
-rw-r--r--scripts/rustc-clif.rs4
-rw-r--r--scripts/rustdoc-clif.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/rustc-clif.rs b/scripts/rustc-clif.rs
index ab496a4a684..7ef3488672d 100644
--- a/scripts/rustc-clif.rs
+++ b/scripts/rustc-clif.rs
@@ -22,7 +22,9 @@ fn main() {
     let mut codegen_backend_arg = OsString::from("-Zcodegen-backend=");
     codegen_backend_arg.push(cg_clif_dylib_path);
     args.push(codegen_backend_arg);
-    if !passed_args.contains(&OsString::from("--sysroot")) {
+    if !passed_args.iter().any(|arg| {
+        arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true)
+    }) {
         args.push(OsString::from("--sysroot"));
         args.push(OsString::from(sysroot.to_str().unwrap()));
     }
diff --git a/scripts/rustdoc-clif.rs b/scripts/rustdoc-clif.rs
index 545844446c5..72024e0d494 100644
--- a/scripts/rustdoc-clif.rs
+++ b/scripts/rustdoc-clif.rs
@@ -22,7 +22,9 @@ fn main() {
     let mut codegen_backend_arg = OsString::from("-Zcodegen-backend=");
     codegen_backend_arg.push(cg_clif_dylib_path);
     args.push(codegen_backend_arg);
-    if !passed_args.contains(&OsString::from("--sysroot")) {
+    if !passed_args.iter().any(|arg| {
+        arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true)
+    }) {
         args.push(OsString::from("--sysroot"));
         args.push(OsString::from(sysroot.to_str().unwrap()));
     }