about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-06-30 17:15:32 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-07-02 12:07:57 +0800
commitcf5788d30dfbb3532c1e4fc18b009bfa51edb310 (patch)
tree82ff1d56964069b421d0c88199f1f6cee7c6d8cd
parent085c24790e591948f788fd294ca3f9858313741c (diff)
downloadrust-cf5788d30dfbb3532c1e4fc18b009bfa51edb310.tar.gz
rust-cf5788d30dfbb3532c1e4fc18b009bfa51edb310.zip
Rename `header` -> `directives`
compiletest has confusingly two terminology to refer to the same concept
-- "headers" and "directives". To make this more self-consistent and
less confusing, stick with "directives" only.

This commit **intentionally** tries to be limited to move-only (modulo
some key usage reference renames) to help git history.
-rw-r--r--src/tools/compiletest/src/directives.rs (renamed from src/tools/compiletest/src/header.rs)4
-rw-r--r--src/tools/compiletest/src/directives/auxiliary.rs (renamed from src/tools/compiletest/src/header/auxiliary.rs)0
-rw-r--r--src/tools/compiletest/src/directives/cfg.rs (renamed from src/tools/compiletest/src/header/cfg.rs)2
-rw-r--r--src/tools/compiletest/src/directives/needs.rs (renamed from src/tools/compiletest/src/header/needs.rs)2
-rw-r--r--src/tools/compiletest/src/directives/test-auxillary/error_annotation.rs (renamed from src/tools/compiletest/src/header/test-auxillary/error_annotation.rs)0
-rw-r--r--src/tools/compiletest/src/directives/test-auxillary/known_directive.rs (renamed from src/tools/compiletest/src/header/test-auxillary/known_directive.rs)0
-rw-r--r--src/tools/compiletest/src/directives/test-auxillary/not_rs.Makefile (renamed from src/tools/compiletest/src/header/test-auxillary/not_rs.Makefile)0
-rw-r--r--src/tools/compiletest/src/directives/test-auxillary/unknown_directive.rs (renamed from src/tools/compiletest/src/header/test-auxillary/unknown_directive.rs)0
-rw-r--r--src/tools/compiletest/src/directives/tests.rs (renamed from src/tools/compiletest/src/header/tests.rs)2
-rw-r--r--src/tools/compiletest/src/lib.rs10
-rw-r--r--src/tools/compiletest/src/runtest.rs2
-rw-r--r--src/tools/rustdoc-gui-test/src/main.rs2
12 files changed, 12 insertions, 12 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/directives.rs
index 5636a146b0f..f5201cdb4b3 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/directives.rs
@@ -13,8 +13,8 @@ use crate::common::{Config, Debugger, FailMode, Mode, PassMode};
 use crate::debuggers::{extract_cdb_version, extract_gdb_version};
 use crate::errors::ErrorKind;
 use crate::executor::{CollectedTestDesc, ShouldPanic};
-use crate::header::auxiliary::{AuxProps, parse_and_update_aux};
-use crate::header::needs::CachedNeedsConditions;
+use crate::directives::auxiliary::{AuxProps, parse_and_update_aux};
+use crate::directives::needs::CachedNeedsConditions;
 use crate::help;
 use crate::util::static_regex;
 
diff --git a/src/tools/compiletest/src/header/auxiliary.rs b/src/tools/compiletest/src/directives/auxiliary.rs
index 0e1f3a785f8..0e1f3a785f8 100644
--- a/src/tools/compiletest/src/header/auxiliary.rs
+++ b/src/tools/compiletest/src/directives/auxiliary.rs
diff --git a/src/tools/compiletest/src/header/cfg.rs b/src/tools/compiletest/src/directives/cfg.rs
index f1f1384afb9..35f6a9e1644 100644
--- a/src/tools/compiletest/src/header/cfg.rs
+++ b/src/tools/compiletest/src/directives/cfg.rs
@@ -1,7 +1,7 @@
 use std::collections::HashSet;
 
 use crate::common::{CompareMode, Config, Debugger};
-use crate::header::IgnoreDecision;
+use crate::directives::IgnoreDecision;
 
 const EXTRA_ARCHS: &[&str] = &["spirv"];
 
diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/directives/needs.rs
index b1165f4bb18..ee46f4c70cb 100644
--- a/src/tools/compiletest/src/header/needs.rs
+++ b/src/tools/compiletest/src/directives/needs.rs
@@ -1,5 +1,5 @@
 use crate::common::{Config, KNOWN_CRATE_TYPES, KNOWN_TARGET_HAS_ATOMIC_WIDTHS, Sanitizer};
-use crate::header::{IgnoreDecision, llvm_has_libzstd};
+use crate::directives::{IgnoreDecision, llvm_has_libzstd};
 
 pub(super) fn handle_needs(
     cache: &CachedNeedsConditions,
diff --git a/src/tools/compiletest/src/header/test-auxillary/error_annotation.rs b/src/tools/compiletest/src/directives/test-auxillary/error_annotation.rs
index fea66a5e07b..fea66a5e07b 100644
--- a/src/tools/compiletest/src/header/test-auxillary/error_annotation.rs
+++ b/src/tools/compiletest/src/directives/test-auxillary/error_annotation.rs
diff --git a/src/tools/compiletest/src/header/test-auxillary/known_directive.rs b/src/tools/compiletest/src/directives/test-auxillary/known_directive.rs
index 99834b14c1e..99834b14c1e 100644
--- a/src/tools/compiletest/src/header/test-auxillary/known_directive.rs
+++ b/src/tools/compiletest/src/directives/test-auxillary/known_directive.rs
diff --git a/src/tools/compiletest/src/header/test-auxillary/not_rs.Makefile b/src/tools/compiletest/src/directives/test-auxillary/not_rs.Makefile
index 4b565e0e6df..4b565e0e6df 100644
--- a/src/tools/compiletest/src/header/test-auxillary/not_rs.Makefile
+++ b/src/tools/compiletest/src/directives/test-auxillary/not_rs.Makefile
diff --git a/src/tools/compiletest/src/header/test-auxillary/unknown_directive.rs b/src/tools/compiletest/src/directives/test-auxillary/unknown_directive.rs
index d4406031043..d4406031043 100644
--- a/src/tools/compiletest/src/header/test-auxillary/unknown_directive.rs
+++ b/src/tools/compiletest/src/directives/test-auxillary/unknown_directive.rs
diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/directives/tests.rs
index 31b49b09bcd..8068a4b5282 100644
--- a/src/tools/compiletest/src/header/tests.rs
+++ b/src/tools/compiletest/src/directives/tests.rs
@@ -19,7 +19,7 @@ fn make_test_description<R: Read>(
 ) -> CollectedTestDesc {
     let cache = HeadersCache::load(config);
     let mut poisoned = false;
-    let test = crate::header::make_test_description(
+    let test = crate::directives::make_test_description(
         config,
         &cache,
         name,
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index 09de3eb4c70..7f2b73eb81b 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -14,7 +14,7 @@ mod debuggers;
 pub mod diagnostics;
 pub mod errors;
 mod executor;
-pub mod header;
+pub mod directives;
 mod json;
 mod raise_fd_limit;
 mod read2;
@@ -37,13 +37,13 @@ use rayon::iter::{ParallelBridge, ParallelIterator};
 use tracing::debug;
 use walkdir::WalkDir;
 
-use self::header::{EarlyProps, make_test_description};
+use self::directives::{EarlyProps, make_test_description};
 use crate::common::{
     CompareMode, Config, Debugger, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path,
     output_base_dir, output_relative_path,
 };
 use crate::executor::{CollectedTest, ColorConfig, OutputFormat};
-use crate::header::HeadersCache;
+use crate::directives::HeadersCache;
 use crate::util::logv;
 
 /// Creates the `Config` instance for this invocation of compiletest.
@@ -254,8 +254,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
         Some(x) => panic!("argument for --color must be auto, always, or never, but found `{}`", x),
     };
     let llvm_version =
-        matches.opt_str("llvm-version").as_deref().map(header::extract_llvm_version).or_else(
-            || header::extract_llvm_version_from_binary(&matches.opt_str("llvm-filecheck")?),
+        matches.opt_str("llvm-version").as_deref().map(directives::extract_llvm_version).or_else(
+            || directives::extract_llvm_version_from_binary(&matches.opt_str("llvm-filecheck")?),
         );
 
     let run_ignored = matches.opt_present("ignored");
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 53b5990d3cd..acc81dda4a8 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -24,7 +24,7 @@ use crate::common::{
 };
 use crate::compute_diff::{DiffLine, make_diff, write_diff, write_filtered_diff};
 use crate::errors::{Error, ErrorKind, load_errors};
-use crate::header::TestProps;
+use crate::directives::TestProps;
 use crate::read2::{Truncated, read2_abbreviated};
 use crate::util::{Utf8PathBufExt, add_dylib_path, logv, static_regex};
 use crate::{ColorConfig, help, json, stamp_file_path, warning};
diff --git a/src/tools/rustdoc-gui-test/src/main.rs b/src/tools/rustdoc-gui-test/src/main.rs
index addb0af4a54..6461f38f527 100644
--- a/src/tools/rustdoc-gui-test/src/main.rs
+++ b/src/tools/rustdoc-gui-test/src/main.rs
@@ -4,7 +4,7 @@ use std::sync::Arc;
 use std::{env, fs};
 
 use build_helper::util::try_run;
-use compiletest::header::TestProps;
+use compiletest::directives::TestProps;
 use config::Config;
 
 mod config;