Skip to content

Commit

Permalink
compiletest: Don't pass --out-dir if the compile flags include -o
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Jun 7, 2024
1 parent 76e7a08 commit 58ba77f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2254,6 +2254,9 @@ impl<'test> TestCx<'test> {
}

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);
}
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 58ba77f

Please sign in to comment.