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