compiletest: Don't pass --out-dir if the compile flags include -o

This commit is contained in:
Zalathar 2024-06-07 15:55:08 +10:00
parent 76e7a0849c
commit 58ba77f4aa
2 changed files with 4 additions and 3 deletions

View File

@ -2254,6 +2254,9 @@ fn make_compile_args(
}
match output_file {
// If the test's compile flags specify an output path with `-o`,
// avoid a compiler warning about `--out-dir` being ignored.
_ if self.props.compile_flags.iter().any(|flag| flag == "-o") => {}
TargetLocation::ThisFile(path) => {
rustc.arg("-o").arg(path);
}

View File

@ -1,6 +1,4 @@
warning: ignoring --out-dir flag due to -o flag
error: io error modifying ./does-not-exist/
error: aborting due to 1 previous error; 1 warning emitted
error: aborting due to 1 previous error