Skip to main content

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