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