diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-10-01 21:45:50 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-10-02 11:16:03 +1000 |
| commit | 59c4dfe59d587f0f09746958bf9a16c271cc02a7 (patch) | |
| tree | fd69c16e5adf9e3cdc8a50b60489318c5317338d /tests | |
| parent | 3369e82c6bc03c5cdb66f730dba6f738b74c8e1d (diff) | |
| download | rust-59c4dfe59d587f0f09746958bf9a16c271cc02a7.tar.gz rust-59c4dfe59d587f0f09746958bf9a16c271cc02a7.zip | |
Forbid `//@ compile-flags: -Cincremental=` in tests
Tests should not try to manually enable incremental compilation with `-Cincremental`, because that typically results in stray directories being created in the repository root. Instead, use the `//@ incremental` directive, which instructs compiletest to handle the details of passing `-Cincremental` with a fresh directory.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/compiletest-self-test/compile-flags-incremental.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/compiletest-self-test/compile-flags-incremental.rs b/tests/ui/compiletest-self-test/compile-flags-incremental.rs new file mode 100644 index 00000000000..62a1ad84d8f --- /dev/null +++ b/tests/ui/compiletest-self-test/compile-flags-incremental.rs @@ -0,0 +1,17 @@ +//@ revisions: good bad bad-space +//@ check-pass + +//@[bad] compile-flags: -Cincremental=true +//@[bad] should-fail + +//@[bad-space] compile-flags: -C incremental=dir +//@[bad-space] should-fail + +fn main() {} + +// Tests should not try to manually enable incremental compilation with +// `-Cincremental`, because that typically results in stray directories being +// created in the repository root. +// +// Instead, use the `//@ incremental` directive, which instructs compiletest +// to handle the details of passing `-Cincremental` with a fresh directory. |
