about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-04-13 23:36:30 +0800
committerGitHub <noreply@github.com>2025-04-13 23:36:30 +0800
commit38f06e3701ea5d8ab3b148fc9462aea22a9caeee (patch)
tree23b6104e4438fef99a7cdc8766e102dee3f2a836 /src/doc/rustc-dev-guide
parentde1dfd37b7aaff171f4c7069bcc295a4f53607fc (diff)
parent8c378f79904fc665516723a41f86cb2b971a70b6 (diff)
downloadrust-38f06e3701ea5d8ab3b148fc9462aea22a9caeee.tar.gz
rust-38f06e3701ea5d8ab3b148fc9462aea22a9caeee.zip
Merge pull request #2321 from jieyouxu/ui-lint-allows
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/tests/ui.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md
index 41dc9299a45..e10bc2daadd 100644
--- a/src/doc/rustc-dev-guide/src/tests/ui.md
+++ b/src/doc/rustc-dev-guide/src/tests/ui.md
@@ -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).