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