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