Merge pull request #2321 from jieyouxu/ui-lint-allows

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2025-04-13 23:36:30 +08:00 committed by GitHub
commit bfdad0b85b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 0 deletions

View File

@ -576,3 +576,26 @@ the term "UI" (*user* interface) and turns such UI tests from black-box tests
into white-box ones. Use them carefully and sparingly.
[compiler debugging]: ../compiler-debugging.md#rustc_-test-attributes
## UI test mode preset lint levels
By default, test suites under UI test mode (`tests/ui`, `tests/ui-fulldeps`,
but not `tests/rustdoc-ui`) will specify
- `-A unused`
- `-A internal_features`
If:
- The ui test's pass mode is below `run` (i.e. check or build).
- No compare modes are specified.
Since they can be very noisy in ui tests.
You can override them with `compile-flags` lint level flags or
in-source lint level attributes as required.
Note that the `rustfix` version will *not* have `-A unused` passed,
meaning that you may have to `#[allow(unused)]` to suppress `unused`
lints on the rustfix'd file (because we might be testing rustfix
on `unused` lints themselves).