compiletest/directives/
directive_names.rs

1use std::collections::HashSet;
2use std::sync::LazyLock;
3
4pub(crate) static KNOWN_DIRECTIVE_NAMES_SET: LazyLock<HashSet<&str>> =
5    LazyLock::new(|| KNOWN_DIRECTIVE_NAMES.iter().copied().collect());
6
7/// This was originally generated by collecting directives from ui tests and then extracting their
8/// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is
9/// a best-effort approximation for diagnostics. Add new directives to this list when needed.
10pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
11    // tidy-alphabetical-start
12    "add-minicore",
13    "assembly-output",
14    "aux-bin",
15    "aux-build",
16    "aux-codegen-backend",
17    "aux-crate",
18    "build-aux-docs",
19    "build-fail",
20    "build-pass",
21    "check-fail",
22    "check-pass",
23    "check-run-results",
24    "check-stdout",
25    "check-test-line-numbers-match",
26    "compare-output-by-lines",
27    "compile-flags",
28    "disable-gdb-pretty-printers",
29    "doc-flags",
30    "dont-check-compiler-stderr",
31    "dont-check-compiler-stdout",
32    "dont-check-failure-status",
33    "dont-require-annotations",
34    "edition",
35    "error-pattern",
36    "exact-llvm-major-version",
37    "exec-env",
38    "failure-status",
39    "filecheck-flags",
40    "forbid-output",
41    "force-host",
42    "ignore-16bit",
43    "ignore-32bit",
44    "ignore-64bit",
45    "ignore-aarch64",
46    "ignore-aarch64-pc-windows-msvc",
47    "ignore-aarch64-unknown-linux-gnu",
48    "ignore-aix",
49    "ignore-android",
50    "ignore-apple",
51    "ignore-arm",
52    "ignore-arm-unknown-linux-gnueabi",
53    "ignore-arm-unknown-linux-gnueabihf",
54    "ignore-arm-unknown-linux-musleabi",
55    "ignore-arm-unknown-linux-musleabihf",
56    "ignore-auxiliary",
57    "ignore-avr",
58    "ignore-backends",
59    "ignore-beta",
60    "ignore-cdb",
61    "ignore-compare-mode-next-solver",
62    "ignore-compare-mode-polonius",
63    "ignore-coverage-map",
64    "ignore-coverage-run",
65    "ignore-cross-compile",
66    "ignore-eabi",
67    "ignore-elf",
68    "ignore-emscripten",
69    "ignore-endian-big",
70    "ignore-enzyme",
71    "ignore-freebsd",
72    "ignore-fuchsia",
73    "ignore-gdb",
74    "ignore-gdb-version",
75    "ignore-gnu",
76    "ignore-haiku",
77    "ignore-horizon",
78    "ignore-i586",
79    "ignore-i686-pc-windows-gnu",
80    "ignore-i686-pc-windows-msvc",
81    "ignore-illumos",
82    "ignore-ios",
83    "ignore-linux",
84    "ignore-lldb",
85    "ignore-llvm-version",
86    "ignore-loongarch32",
87    "ignore-loongarch64",
88    "ignore-macabi",
89    "ignore-macos",
90    "ignore-msp430",
91    "ignore-msvc",
92    "ignore-musl",
93    "ignore-netbsd",
94    "ignore-nightly",
95    "ignore-none",
96    "ignore-nto",
97    "ignore-nvptx64",
98    "ignore-nvptx64-nvidia-cuda",
99    "ignore-openbsd",
100    "ignore-pass",
101    "ignore-powerpc",
102    "ignore-powerpc64",
103    "ignore-remote",
104    "ignore-riscv64",
105    "ignore-rustc-debug-assertions",
106    "ignore-rustc_abi-x86-sse2",
107    "ignore-s390x",
108    "ignore-sgx",
109    "ignore-sparc64",
110    "ignore-spirv",
111    "ignore-stable",
112    "ignore-stage1",
113    "ignore-stage2",
114    "ignore-std-debug-assertions",
115    "ignore-test",
116    "ignore-thumb",
117    "ignore-thumbv8m.base-none-eabi",
118    "ignore-thumbv8m.main-none-eabi",
119    "ignore-tvos",
120    "ignore-unix",
121    "ignore-unknown",
122    "ignore-uwp",
123    "ignore-visionos",
124    "ignore-vxworks",
125    "ignore-wasi",
126    "ignore-wasm",
127    "ignore-wasm32",
128    "ignore-wasm32-unknown-unknown",
129    "ignore-wasm64",
130    "ignore-watchos",
131    "ignore-windows",
132    "ignore-windows-gnu",
133    "ignore-windows-msvc",
134    "ignore-x32",
135    "ignore-x86",
136    "ignore-x86_64",
137    "ignore-x86_64-apple-darwin",
138    "ignore-x86_64-pc-windows-gnu",
139    "ignore-x86_64-unknown-linux-gnu",
140    "incremental",
141    "known-bug",
142    "llvm-cov-flags",
143    "max-llvm-major-version",
144    "min-cdb-version",
145    "min-gdb-version",
146    "min-lldb-version",
147    "min-llvm-version",
148    "min-system-llvm-version",
149    "minicore-compile-flags",
150    "needs-asm-support",
151    "needs-backends",
152    "needs-crate-type",
153    "needs-deterministic-layouts",
154    "needs-dlltool",
155    "needs-dynamic-linking",
156    "needs-enzyme",
157    "needs-force-clang-based-tests",
158    "needs-git-hash",
159    "needs-llvm-components",
160    "needs-llvm-zstd",
161    "needs-profiler-runtime",
162    "needs-relocation-model-pic",
163    "needs-run-enabled",
164    "needs-rust-lld",
165    "needs-rustc-debug-assertions",
166    "needs-sanitizer-address",
167    "needs-sanitizer-cfi",
168    "needs-sanitizer-dataflow",
169    "needs-sanitizer-hwaddress",
170    "needs-sanitizer-kcfi",
171    "needs-sanitizer-leak",
172    "needs-sanitizer-memory",
173    "needs-sanitizer-memtag",
174    "needs-sanitizer-realtime",
175    "needs-sanitizer-safestack",
176    "needs-sanitizer-shadow-call-stack",
177    "needs-sanitizer-support",
178    "needs-sanitizer-thread",
179    "needs-std-debug-assertions",
180    "needs-subprocess",
181    "needs-symlink",
182    "needs-target-has-atomic",
183    "needs-target-std",
184    "needs-threads",
185    "needs-unwind",
186    "needs-wasmtime",
187    "needs-xray",
188    "no-auto-check-cfg",
189    "no-prefer-dynamic",
190    "normalize-stderr",
191    "normalize-stderr-32bit",
192    "normalize-stderr-64bit",
193    "normalize-stdout",
194    "only-16bit",
195    "only-32bit",
196    "only-64bit",
197    "only-aarch64",
198    "only-aarch64-apple-darwin",
199    "only-aarch64-unknown-linux-gnu",
200    "only-aarch64-unknown-uefi",
201    "only-apple",
202    "only-arm",
203    "only-arm64ec",
204    "only-avr",
205    "only-beta",
206    "only-bpf",
207    "only-cdb",
208    "only-dist",
209    "only-eabihf",
210    "only-elf",
211    "only-emscripten",
212    "only-gnu",
213    "only-i686-pc-windows-gnu",
214    "only-i686-pc-windows-msvc",
215    "only-i686-unknown-linux-gnu",
216    "only-ios",
217    "only-linux",
218    "only-loongarch32",
219    "only-loongarch64",
220    "only-loongarch64-unknown-linux-gnu",
221    "only-macos",
222    "only-mips",
223    "only-mips64",
224    "only-msp430",
225    "only-msvc",
226    "only-musl",
227    "only-nightly",
228    "only-nvptx64",
229    "only-powerpc",
230    "only-riscv32",
231    "only-riscv64",
232    "only-rustc_abi-x86-sse2",
233    "only-s390x",
234    "only-sparc",
235    "only-sparc64",
236    "only-stable",
237    "only-thumb",
238    "only-tvos",
239    "only-uefi",
240    "only-unix",
241    "only-visionos",
242    "only-wasm32",
243    "only-wasm32-unknown-unknown",
244    "only-wasm32-wasip1",
245    "only-watchos",
246    "only-windows",
247    "only-windows-gnu",
248    "only-windows-msvc",
249    "only-x86",
250    "only-x86_64",
251    "only-x86_64-apple-darwin",
252    "only-x86_64-fortanix-unknown-sgx",
253    "only-x86_64-pc-windows-gnu",
254    "only-x86_64-pc-windows-msvc",
255    "only-x86_64-unknown-linux-gnu",
256    "pp-exact",
257    "pretty-compare-only",
258    "pretty-mode",
259    "proc-macro",
260    "reference",
261    "regex-error-pattern",
262    "remap-src-base",
263    "revisions",
264    "run-crash",
265    "run-fail",
266    "run-fail-or-crash",
267    "run-flags",
268    "run-pass",
269    "run-rustfix",
270    "rustc-env",
271    "rustfix-only-machine-applicable",
272    "should-fail",
273    "should-ice",
274    "stderr-per-bitwidth",
275    "test-mir-pass",
276    "unique-doc-out-dir",
277    "unset-exec-env",
278    "unset-rustc-env",
279    // Used by the tidy check `unknown_revision`.
280    "unused-revision-names",
281    // tidy-alphabetical-end
282];
283
284pub(crate) const KNOWN_HTMLDOCCK_DIRECTIVE_NAMES: &[&str] = &[
285    "count",
286    "!count",
287    "files",
288    "!files",
289    "has",
290    "!has",
291    "has-dir",
292    "!has-dir",
293    "hasraw",
294    "!hasraw",
295    "matches",
296    "!matches",
297    "matchesraw",
298    "!matchesraw",
299    "snapshot",
300    "!snapshot",
301];
302
303pub(crate) const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] =
304    &["count", "!count", "has", "!has", "is", "!is", "ismany", "!ismany", "set", "!set"];