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