Skip to content

Commit ee5fed0

Browse files
committed
tests: document -A {unused,internal_features} ui test mode presets
1 parent cdc10f0 commit ee5fed0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: src/tests/ui.md

+23
Original file line numberDiff line numberDiff line change
@@ -576,3 +576,26 @@ the term "UI" (*user* interface) and turns such UI tests from black-box tests
576576
into white-box ones. Use them carefully and sparingly.
577577

578578
[compiler debugging]: ../compiler-debugging.md#rustc_test-attributes
579+
580+
## UI test mode preset lint levels
581+
582+
By default, test suites under UI test mode (`tests/ui`, `tests/ui-fulldeps`,
583+
but not `tests/rustdoc-ui`) will specify
584+
585+
- `-A unused`
586+
- `-A internal_features`
587+
588+
If:
589+
590+
- The ui test's pass mode is below `run` (i.e. check or build).
591+
- No compare modes are specified.
592+
593+
Since they can be very noisy in ui tests.
594+
595+
You can override them with `compile-flags` lint level flags or
596+
in-source lint level attributes as required.
597+
598+
Note that the `rustfix` version will *not* have `-A unused` passed,
599+
meaning that you may have to `#[allow(unused)]` to suppress `unused`
600+
lints on the rustfix'd file (because we might be testing rustfix
601+
on `unused` lints themselves).

0 commit comments

Comments
 (0)