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