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    "act-as-stable",
13    "add-minicore",
14    "assembly-output",
15    "aux-bin",
16    "aux-build",
17    "aux-codegen-backend",
18    "aux-crate",
19    "aux-lint",
20    "build-aux-docs",
21    "build-fail",
22    "build-pass",
23    "cdb-check",
24    "cdb-command",
25    "check-fail",
26    "check-pass",
27    "check-run-results",
28    "check-stdout",
29    "check-test-line-numbers-match",
30    "compare-output-by-lines",
31    "compile-flags",
32    "disable-gdb-pretty-printers",
33    "doc-flags",
34    "dont-check-compiler-stderr",
35    "dont-check-compiler-stdout",
36    "dont-check-failure-status",
37    "dont-require-annotations",
38    "edition",
39    "error-pattern",
40    "exact-llvm-major-version",
41    "exec-env",
42    "failure-status",
43    "filecheck-flags",
44    "forbid-output",
45    "force-host",
46    "gdb-check",
47    "gdb-command",
48    "gdb-repr",
49    "ignore-16bit",
50    "ignore-32bit",
51    "ignore-64bit",
52    "ignore-aarch64",
53    "ignore-aarch64-pc-windows-msvc",
54    "ignore-aarch64-unknown-linux-gnu",
55    "ignore-aix",
56    "ignore-android",
57    "ignore-apple",
58    "ignore-arm",
59    "ignore-arm-unknown-linux-gnueabi",
60    "ignore-arm-unknown-linux-gnueabihf",
61    "ignore-arm-unknown-linux-musleabi",
62    "ignore-arm-unknown-linux-musleabihf",
63    "ignore-auxiliary",
64    "ignore-avr",
65    "ignore-backends",
66    "ignore-beta",
67    "ignore-bpf",
68    "ignore-cdb",
69    "ignore-compare-mode-next-solver",
70    "ignore-compare-mode-polonius",
71    "ignore-coverage-map",
72    "ignore-coverage-run",
73    "ignore-cross-compile",
74    "ignore-csky",
75    "ignore-eabi",
76    "ignore-elf",
77    "ignore-emscripten",
78    "ignore-endian-big",
79    "ignore-enzyme",
80    "ignore-freebsd",
81    "ignore-fuchsia",
82    "ignore-gdb",
83    "ignore-gdb-version",
84    "ignore-gnu",
85    "ignore-haiku",
86    "ignore-horizon",
87    "ignore-i586",
88    "ignore-i686-pc-windows-gnu",
89    "ignore-i686-pc-windows-msvc",
90    "ignore-illumos",
91    "ignore-ios",
92    "ignore-linux",
93    "ignore-lldb",
94    "ignore-llvm-version",
95    "ignore-loongarch32",
96    "ignore-loongarch64",
97    "ignore-macabi",
98    "ignore-macos",
99    "ignore-mips",
100    "ignore-mips64",
101    "ignore-msp430",
102    "ignore-msvc",
103    "ignore-musl",
104    "ignore-netbsd",
105    "ignore-nightly",
106    "ignore-none",
107    "ignore-nto",
108    "ignore-nvptx64",
109    "ignore-nvptx64-nvidia-cuda",
110    "ignore-ohos",
111    "ignore-openbsd",
112    "ignore-parallel-frontend",
113    "ignore-pauthtest",
114    "ignore-powerpc",
115    "ignore-powerpc64",
116    "ignore-qnx",
117    "ignore-remote",
118    "ignore-riscv32",
119    "ignore-riscv64",
120    "ignore-rustc-debug-assertions",
121    "ignore-rustc_abi-x86-sse2",
122    "ignore-s390x",
123    "ignore-sgx",
124    "ignore-sparc64",
125    "ignore-spirv",
126    "ignore-stable",
127    "ignore-stage1",
128    "ignore-stage2",
129    "ignore-std-debug-assertions",
130    "ignore-test",
131    "ignore-thumb",
132    "ignore-thumbv8m.base-none-eabi",
133    "ignore-thumbv8m.main-none-eabi",
134    "ignore-tvos",
135    "ignore-uefi",
136    "ignore-unix",
137    "ignore-unknown",
138    "ignore-uwp",
139    "ignore-visionos",
140    "ignore-vxworks",
141    "ignore-wasi",
142    "ignore-wasm",
143    "ignore-wasm-proc-macros",
144    "ignore-wasm32",
145    "ignore-wasm32-unknown-unknown",
146    "ignore-wasm64",
147    "ignore-watchos",
148    "ignore-windows",
149    "ignore-windows-gnu",
150    "ignore-windows-msvc",
151    "ignore-x32",
152    "ignore-x86",
153    "ignore-x86_64",
154    "ignore-x86_64-apple-darwin",
155    "ignore-x86_64-pc-windows-gnu",
156    "ignore-x86_64-pc-windows-gnullvm",
157    "ignore-x86_64-unknown-linux-gnu",
158    "incremental",
159    "known-bug",
160    "lldb-check",
161    "lldb-command",
162    "lldb-repr",
163    "llvm-cov-flags",
164    "max-llvm-major-version",
165    "min-apple-lldb-version",
166    "min-cdb-version",
167    "min-gdb-version",
168    "min-llvm-lldb-version",
169    "min-llvm-version",
170    "min-system-llvm-version",
171    "minicore-compile-flags",
172    "needs-asm-ret",
173    "needs-asm-support",
174    "needs-backends",
175    "needs-crate-type",
176    "needs-deterministic-layouts",
177    "needs-dlltool",
178    "needs-dynamic-linking",
179    "needs-enzyme",
180    "needs-force-clang-based-tests",
181    "needs-git-hash",
182    "needs-llvm-components",
183    "needs-llvm-zstd",
184    "needs-offload",
185    "needs-profiler-runtime",
186    "needs-relocation-model-pic",
187    "needs-run-enabled",
188    "needs-rust-lld",
189    "needs-rustc-debug-assertions",
190    "needs-sanitizer-address",
191    "needs-sanitizer-cfi",
192    "needs-sanitizer-dataflow",
193    "needs-sanitizer-hwaddress",
194    "needs-sanitizer-kasan",
195    "needs-sanitizer-kcfi",
196    "needs-sanitizer-khwasan",
197    "needs-sanitizer-leak",
198    "needs-sanitizer-memory",
199    "needs-sanitizer-memtag",
200    "needs-sanitizer-realtime",
201    "needs-sanitizer-safestack",
202    "needs-sanitizer-shadow-call-stack",
203    "needs-sanitizer-support",
204    "needs-sanitizer-thread",
205    "needs-std-debug-assertions",
206    "needs-std-remap-debuginfo",
207    "needs-subprocess",
208    "needs-symlink",
209    "needs-target-has-atomic",
210    "needs-target-std",
211    "needs-threads",
212    "needs-tpde",
213    "needs-unwind",
214    "needs-wasmtime",
215    "needs-xray",
216    "no-auto-check-cfg",
217    "no-pass-override",
218    "no-prefer-dynamic",
219    "normalize-stderr",
220    "normalize-stderr-32bit",
221    "normalize-stderr-64bit",
222    "normalize-stdout",
223    "only-16bit",
224    "only-32bit",
225    "only-64bit",
226    "only-aarch64",
227    "only-aarch64-apple-darwin",
228    "only-aarch64-unknown-linux-gnu",
229    "only-aarch64-unknown-uefi",
230    "only-apple",
231    "only-arm",
232    "only-arm64ec",
233    "only-armv7-unknown-linux-gnueabihf",
234    "only-avr",
235    "only-beta",
236    "only-bpf",
237    "only-cdb",
238    "only-dist",
239    "only-eabihf",
240    "only-elf",
241    "only-emscripten",
242    "only-endian-big",
243    "only-gnu",
244    "only-i686-pc-windows-gnu",
245    "only-i686-pc-windows-msvc",
246    "only-i686-unknown-linux-gnu",
247    "only-ios",
248    "only-linux",
249    "only-loongarch32",
250    "only-loongarch64",
251    "only-loongarch64-unknown-linux-gnu",
252    "only-macos",
253    "only-mips",
254    "only-mips64",
255    "only-msp430",
256    "only-msvc",
257    "only-musl",
258    "only-nightly",
259    "only-nvptx64",
260    "only-pauthtest",
261    "only-powerpc",
262    "only-riscv32",
263    "only-riscv64",
264    "only-riscv64gc-unknown-linux-gnu",
265    "only-rustc_abi-x86-sse2",
266    "only-s390x",
267    "only-sparc",
268    "only-sparc64",
269    "only-stable",
270    "only-thumb",
271    "only-tvos",
272    "only-uefi",
273    "only-unix",
274    "only-visionos",
275    "only-wasm-proc-macros",
276    "only-wasm32",
277    "only-wasm32-unknown-emscripten",
278    "only-wasm32-unknown-unknown",
279    "only-watchos",
280    "only-windows",
281    "only-windows-gnu",
282    "only-windows-msvc",
283    "only-x86",
284    "only-x86_64",
285    "only-x86_64-apple-darwin",
286    "only-x86_64-fortanix-unknown-sgx",
287    "only-x86_64-pc-windows-gnu",
288    "only-x86_64-pc-windows-gnullvm",
289    "only-x86_64-pc-windows-msvc",
290    "only-x86_64-unknown-linux-gnu",
291    "pp-exact",
292    "pretty-compare-only",
293    "pretty-mode",
294    "proc-macro",
295    "reference",
296    "regex-error-pattern",
297    "remap-src-base",
298    "revisions",
299    "run-crash",
300    "run-fail",
301    "run-fail-or-crash",
302    "run-flags",
303    "run-pass",
304    "run-rustfix",
305    "rustc-env",
306    "rustfix-only-machine-applicable",
307    "should-fail",
308    "skip-filecheck",
309    "stderr-per-bitwidth",
310    "test-mir-pass",
311    "unique-doc-out-dir",
312    "unset-exec-env",
313    "unset-rustc-env",
314    // Used by the tidy check `unknown_revision`.
315    "unused-revision-names",
316    "use-rustdoc-cci-doc-meta-merge",
317    // tidy-alphabetical-end
318];
319
320pub(crate) const KNOWN_HTMLDOCCK_DIRECTIVE_NAMES: &[&str] = &[
321    "count",
322    "!count",
323    "files",
324    "!files",
325    "has",
326    "!has",
327    "has-dir",
328    "!has-dir",
329    "hasraw",
330    "!hasraw",
331    "matches",
332    "!matches",
333    "matchesraw",
334    "!matchesraw",
335    "snapshot",
336    "!snapshot",
337];
338
339pub(crate) const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] = &[
340    "count",
341    "!count",
342    "has",
343    "!has",
344    "is",
345    "!is",
346    "ismany",
347    "!ismany",
348    "set",
349    "jq_count",
350    "!jq_count",
351    "jq_has",
352    "!jq_has",
353    "jq_is",
354    "!jq_is",
355    "jq_ismany",
356    "!jq_ismany",
357    "jq_set",
358];