Fix rustc test suite

This commit is contained in:
bjorn3 2023-05-04 11:24:58 +00:00
parent edd0e5df3b
commit 7905fa92ce
2 changed files with 6 additions and 2 deletions

View File

@ -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()));
}

View File

@ -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()));
}