Skip to content

Commit 58ba77f

Browse files
committed
compiletest: Don't pass --out-dir if the compile flags include -o
1 parent 76e7a08 commit 58ba77f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/tools/compiletest/src/runtest.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,9 @@ impl<'test> TestCx<'test> {
22542254
}
22552255

22562256
match output_file {
2257+
// If the test's compile flags specify an output path with `-o`,
2258+
// avoid a compiler warning about `--out-dir` being ignored.
2259+
_ if self.props.compile_flags.iter().any(|flag| flag == "-o") => {}
22572260
TargetLocation::ThisFile(path) => {
22582261
rustc.arg("-o").arg(path);
22592262
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
warning: ignoring --out-dir flag due to -o flag
2-
31
error: io error modifying ./does-not-exist/
42

5-
error: aborting due to 1 previous error; 1 warning emitted
3+
error: aborting due to 1 previous error
64

0 commit comments

Comments
 (0)