diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-06-07 15:55:08 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-06-07 15:55:36 +1000 |
| commit | 58ba77f4aa46ca94f643eebe8f61a44f56c8abd5 (patch) | |
| tree | 214c7464df63c2fdc90d8fb9929a86af9275caa9 | |
| parent | 76e7a0849c07d73e4d9afde8036ee8c450127cc8 (diff) | |
| download | rust-58ba77f4aa46ca94f643eebe8f61a44f56c8abd5.tar.gz rust-58ba77f4aa46ca94f643eebe8f61a44f56c8abd5.zip | |
compiletest: Don't pass `--out-dir` if the compile flags include `-o`
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 3 | ||||
| -rw-r--r-- | tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 2c425a07b2a..a7511a6f457 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -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); } diff --git a/tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr b/tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr index 5775a4032c3..48cae82feb0 100644 --- a/tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr +++ b/tests/ui/io-checks/non-ice-error-on-worker-io-fail.stderr @@ -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 |
