Skip to content

Commit ba82950

Browse files
authored
Rollup merge of #144662 - Zalathar:directive-names, r=fmease
compiletest: Move directive names back into a separate file This list no longer needs to be included in multiple crates, but having the list in its own file makes it easier to find and update when necessary. As discussed at #143850 (comment).
2 parents 38e7615 + dee2013 commit ba82950

2 files changed

Lines changed: 293 additions & 290 deletions

File tree

‎src/tools/compiletest/src/directives.rs‎

Lines changed: 4 additions & 290 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ use tracing::*;
1212
usecrate::common::{CodegenBackend,Config,Debugger,FailMode,PassMode,RunFailMode,TestMode};
1313
usecrate::debuggers::{extract_cdb_version, extract_gdb_version};
1414
usecrate::directives::auxiliary::{AuxProps, parse_and_update_aux};
15+
usecrate::directives::directive_names::{
16+
KNOWN_DIRECTIVE_NAMES,KNOWN_HTMLDOCCK_DIRECTIVE_NAMES,KNOWN_JSONDOCCK_DIRECTIVE_NAMES,
17+
};
1518
usecrate::directives::needs::CachedNeedsConditions;
1619
usecrate::errors::ErrorKind;
1720
usecrate::executor::{CollectedTestDesc,ShouldPanic};
@@ -20,6 +23,7 @@ use crate::util::static_regex;
2023

2124
pub(crate)mod auxiliary;
2225
mod cfg;
26+
mod directive_names;
2327
mod needs;
2428
#[cfg(test)]
2529
mod tests;
@@ -825,296 +829,6 @@ fn line_directive<'line>(
825829
Some(DirectiveLine{ line_number, revision, raw_directive })
826830
}
827831

828-
/// This was originally generated by collecting directives from ui tests and then extracting their
829-
/// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is
830-
/// a best-effort approximation for diagnostics. Add new directives to this list when needed.
831-
constKNOWN_DIRECTIVE_NAMES:&[&str] = &[
832-
// tidy-alphabetical-start
833-
"add-core-stubs",
834-
"assembly-output",
835-
"aux-bin",
836-
"aux-build",
837-
"aux-codegen-backend",
838-
"aux-crate",
839-
"build-aux-docs",
840-
"build-fail",
841-
"build-pass",
842-
"check-fail",
843-
"check-pass",
844-
"check-run-results",
845-
"check-stdout",
846-
"check-test-line-numbers-match",
847-
"compile-flags",
848-
"doc-flags",
849-
"dont-check-compiler-stderr",
850-
"dont-check-compiler-stdout",
851-
"dont-check-failure-status",
852-
"dont-require-annotations",
853-
"edition",
854-
"error-pattern",
855-
"exact-llvm-major-version",
856-
"exec-env",
857-
"failure-status",
858-
"filecheck-flags",
859-
"forbid-output",
860-
"force-host",
861-
"ignore-16bit",
862-
"ignore-32bit",
863-
"ignore-64bit",
864-
"ignore-aarch64",
865-
"ignore-aarch64-pc-windows-msvc",
866-
"ignore-aarch64-unknown-linux-gnu",
867-
"ignore-aix",
868-
"ignore-android",
869-
"ignore-apple",
870-
"ignore-arm",
871-
"ignore-arm-unknown-linux-gnueabi",
872-
"ignore-arm-unknown-linux-gnueabihf",
873-
"ignore-arm-unknown-linux-musleabi",
874-
"ignore-arm-unknown-linux-musleabihf",
875-
"ignore-auxiliary",
876-
"ignore-avr",
877-
"ignore-backends",
878-
"ignore-beta",
879-
"ignore-cdb",
880-
"ignore-compare-mode-next-solver",
881-
"ignore-compare-mode-polonius",
882-
"ignore-coverage-map",
883-
"ignore-coverage-run",
884-
"ignore-cross-compile",
885-
"ignore-eabi",
886-
"ignore-elf",
887-
"ignore-emscripten",
888-
"ignore-endian-big",
889-
"ignore-enzyme",
890-
"ignore-freebsd",
891-
"ignore-fuchsia",
892-
"ignore-gdb",
893-
"ignore-gdb-version",
894-
"ignore-gnu",
895-
"ignore-haiku",
896-
"ignore-horizon",
897-
"ignore-i686-pc-windows-gnu",
898-
"ignore-i686-pc-windows-msvc",
899-
"ignore-illumos",
900-
"ignore-ios",
901-
"ignore-linux",
902-
"ignore-lldb",
903-
"ignore-llvm-version",
904-
"ignore-loongarch32",
905-
"ignore-loongarch64",
906-
"ignore-macabi",
907-
"ignore-macos",
908-
"ignore-msp430",
909-
"ignore-msvc",
910-
"ignore-musl",
911-
"ignore-netbsd",
912-
"ignore-nightly",
913-
"ignore-none",
914-
"ignore-nto",
915-
"ignore-nvptx64",
916-
"ignore-nvptx64-nvidia-cuda",
917-
"ignore-openbsd",
918-
"ignore-pass",
919-
"ignore-powerpc",
920-
"ignore-powerpc64",
921-
"ignore-remote",
922-
"ignore-riscv64",
923-
"ignore-rustc-debug-assertions",
924-
"ignore-rustc_abi-x86-sse2",
925-
"ignore-s390x",
926-
"ignore-sgx",
927-
"ignore-sparc64",
928-
"ignore-spirv",
929-
"ignore-stable",
930-
"ignore-stage1",
931-
"ignore-stage2",
932-
"ignore-std-debug-assertions",
933-
"ignore-test",
934-
"ignore-thumb",
935-
"ignore-thumbv8m.base-none-eabi",
936-
"ignore-thumbv8m.main-none-eabi",
937-
"ignore-tvos",
938-
"ignore-unix",
939-
"ignore-unknown",
940-
"ignore-uwp",
941-
"ignore-visionos",
942-
"ignore-vxworks",
943-
"ignore-wasi",
944-
"ignore-wasm",
945-
"ignore-wasm32",
946-
"ignore-wasm32-bare",
947-
"ignore-wasm64",
948-
"ignore-watchos",
949-
"ignore-windows",
950-
"ignore-windows-gnu",
951-
"ignore-windows-msvc",
952-
"ignore-x32",
953-
"ignore-x86",
954-
"ignore-x86_64",
955-
"ignore-x86_64-apple-darwin",
956-
"ignore-x86_64-pc-windows-gnu",
957-
"ignore-x86_64-unknown-linux-gnu",
958-
"incremental",
959-
"known-bug",
960-
"llvm-cov-flags",
961-
"max-llvm-major-version",
962-
"min-cdb-version",
963-
"min-gdb-version",
964-
"min-lldb-version",
965-
"min-llvm-version",
966-
"min-system-llvm-version",
967-
"needs-asm-support",
968-
"needs-backends",
969-
"needs-crate-type",
970-
"needs-deterministic-layouts",
971-
"needs-dlltool",
972-
"needs-dynamic-linking",
973-
"needs-enzyme",
974-
"needs-force-clang-based-tests",
975-
"needs-git-hash",
976-
"needs-llvm-components",
977-
"needs-llvm-zstd",
978-
"needs-profiler-runtime",
979-
"needs-relocation-model-pic",
980-
"needs-run-enabled",
981-
"needs-rust-lld",
982-
"needs-rustc-debug-assertions",
983-
"needs-sanitizer-address",
984-
"needs-sanitizer-cfi",
985-
"needs-sanitizer-dataflow",
986-
"needs-sanitizer-hwaddress",
987-
"needs-sanitizer-kcfi",
988-
"needs-sanitizer-leak",
989-
"needs-sanitizer-memory",
990-
"needs-sanitizer-memtag",
991-
"needs-sanitizer-safestack",
992-
"needs-sanitizer-shadow-call-stack",
993-
"needs-sanitizer-support",
994-
"needs-sanitizer-thread",
995-
"needs-std-debug-assertions",
996-
"needs-subprocess",
997-
"needs-symlink",
998-
"needs-target-has-atomic",
999-
"needs-target-std",
1000-
"needs-threads",
1001-
"needs-unwind",
1002-
"needs-wasmtime",
1003-
"needs-xray",
1004-
"no-auto-check-cfg",
1005-
"no-prefer-dynamic",
1006-
"normalize-stderr",
1007-
"normalize-stderr-32bit",
1008-
"normalize-stderr-64bit",
1009-
"normalize-stdout",
1010-
"only-16bit",
1011-
"only-32bit",
1012-
"only-64bit",
1013-
"only-aarch64",
1014-
"only-aarch64-apple-darwin",
1015-
"only-aarch64-unknown-linux-gnu",
1016-
"only-apple",
1017-
"only-arm",
1018-
"only-avr",
1019-
"only-beta",
1020-
"only-bpf",
1021-
"only-cdb",
1022-
"only-dist",
1023-
"only-elf",
1024-
"only-emscripten",
1025-
"only-gnu",
1026-
"only-i686-pc-windows-gnu",
1027-
"only-i686-pc-windows-msvc",
1028-
"only-i686-unknown-linux-gnu",
1029-
"only-ios",
1030-
"only-linux",
1031-
"only-loongarch32",
1032-
"only-loongarch64",
1033-
"only-loongarch64-unknown-linux-gnu",
1034-
"only-macos",
1035-
"only-mips",
1036-
"only-mips64",
1037-
"only-msp430",
1038-
"only-msvc",
1039-
"only-musl",
1040-
"only-nightly",
1041-
"only-nvptx64",
1042-
"only-powerpc",
1043-
"only-riscv64",
1044-
"only-rustc_abi-x86-sse2",
1045-
"only-s390x",
1046-
"only-sparc",
1047-
"only-sparc64",
1048-
"only-stable",
1049-
"only-thumb",
1050-
"only-tvos",
1051-
"only-uefi",
1052-
"only-unix",
1053-
"only-visionos",
1054-
"only-wasm32",
1055-
"only-wasm32-bare",
1056-
"only-wasm32-wasip1",
1057-
"only-watchos",
1058-
"only-windows",
1059-
"only-windows-gnu",
1060-
"only-windows-msvc",
1061-
"only-x86",
1062-
"only-x86_64",
1063-
"only-x86_64-apple-darwin",
1064-
"only-x86_64-fortanix-unknown-sgx",
1065-
"only-x86_64-pc-windows-gnu",
1066-
"only-x86_64-pc-windows-msvc",
1067-
"only-x86_64-unknown-linux-gnu",
1068-
"pp-exact",
1069-
"pretty-compare-only",
1070-
"pretty-mode",
1071-
"proc-macro",
1072-
"reference",
1073-
"regex-error-pattern",
1074-
"remap-src-base",
1075-
"revisions",
1076-
"run-crash",
1077-
"run-fail",
1078-
"run-fail-or-crash",
1079-
"run-flags",
1080-
"run-pass",
1081-
"run-rustfix",
1082-
"rustc-env",
1083-
"rustfix-only-machine-applicable",
1084-
"should-fail",
1085-
"should-ice",
1086-
"stderr-per-bitwidth",
1087-
"test-mir-pass",
1088-
"unique-doc-out-dir",
1089-
"unset-exec-env",
1090-
"unset-rustc-env",
1091-
// Used by the tidy check `unknown_revision`.
1092-
"unused-revision-names",
1093-
// tidy-alphabetical-end
1094-
];
1095-
1096-
constKNOWN_HTMLDOCCK_DIRECTIVE_NAMES:&[&str] = &[
1097-
"count",
1098-
"!count",
1099-
"files",
1100-
"!files",
1101-
"has",
1102-
"!has",
1103-
"has-dir",
1104-
"!has-dir",
1105-
"hasraw",
1106-
"!hasraw",
1107-
"matches",
1108-
"!matches",
1109-
"matchesraw",
1110-
"!matchesraw",
1111-
"snapshot",
1112-
"!snapshot",
1113-
];
1114-
1115-
constKNOWN_JSONDOCCK_DIRECTIVE_NAMES:&[&str] =
1116-
&["count","!count","has","!has","is","!is","ismany","!ismany","set","!set"];
1117-
1118832
/// The (partly) broken-down contents of a line containing a test directive,
1119833
/// which [`iter_directives`] passes to its callback function.
1120834
///

0 commit comments

Comments
 (0)