Skip to content

Commit 9d187f3

Browse files
committed
Rename {HeadersCache, iter_header} -> {DirectivesCache, iter_directives} for self-consistency
1 parent 5dc8127 commit 9d187f3

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/tools/compiletest/src/directives.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ mod needs;
2424
#[cfg(test)]
2525
mod tests;
2626

27-
pub struct HeadersCache {
27+
pub struct DirectivesCache {
2828
needs: CachedNeedsConditions,
2929
}
3030

31-
impl HeadersCache {
31+
impl DirectivesCache {
3232
pub fn load(config: &Config) -> Self {
3333
Self { needs: CachedNeedsConditions::load(config) }
3434
}
@@ -54,7 +54,7 @@ impl EarlyProps {
5454
pub fn from_reader<R: Read>(config: &Config, testfile: &Utf8Path, rdr: R) -> Self {
5555
let mut props = EarlyProps::default();
5656
let mut poisoned = false;
57-
iter_header(
57+
iter_directives(
5858
config.mode,
5959
&config.suite,
6060
&mut poisoned,
@@ -347,7 +347,7 @@ impl TestProps {
347347

348348
let mut poisoned = false;
349349

350-
iter_header(
350+
iter_directives(
351351
config.mode,
352352
&config.suite,
353353
&mut poisoned,
@@ -794,7 +794,7 @@ const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] =
794794
&["count", "!count", "has", "!has", "is", "!is", "ismany", "!ismany", "set", "!set"];
795795

796796
/// The (partly) broken-down contents of a line containing a test directive,
797-
/// which [`iter_header`] passes to its callback function.
797+
/// which [`iter_directives`] passes to its callback function.
798798
///
799799
/// For example:
800800
///
@@ -867,7 +867,7 @@ pub(crate) fn check_directive<'a>(
867867

868868
const COMPILETEST_DIRECTIVE_PREFIX: &str = "//@";
869869

870-
fn iter_header(
870+
fn iter_directives(
871871
mode: Mode,
872872
_suite: &str,
873873
poisoned: &mut bool,
@@ -1372,7 +1372,7 @@ where
13721372

13731373
pub(crate) fn make_test_description<R: Read>(
13741374
config: &Config,
1375-
cache: &HeadersCache,
1375+
cache: &DirectivesCache,
13761376
name: String,
13771377
path: &Utf8Path,
13781378
src: R,
@@ -1386,7 +1386,7 @@ pub(crate) fn make_test_description<R: Read>(
13861386
let mut local_poisoned = false;
13871387

13881388
// Scan through the test file to handle `ignore-*`, `only-*`, and `needs-*` directives.
1389-
iter_header(
1389+
iter_directives(
13901390
config.mode,
13911391
&config.suite,
13921392
&mut local_poisoned,

src/tools/compiletest/src/directives/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use camino::Utf8Path;
44
use semver::Version;
55

66
use super::{
7-
EarlyProps, HeadersCache, extract_llvm_version, extract_version_range, iter_header,
7+
DirectivesCache, EarlyProps, extract_llvm_version, extract_version_range, iter_directives,
88
parse_normalize_rule,
99
};
1010
use crate::common::{Config, Debugger, Mode};
@@ -17,7 +17,7 @@ fn make_test_description<R: Read>(
1717
src: R,
1818
revision: Option<&str>,
1919
) -> CollectedTestDesc {
20-
let cache = HeadersCache::load(config);
20+
let cache = DirectivesCache::load(config);
2121
let mut poisoned = false;
2222
let test = crate::directives::make_test_description(
2323
config,
@@ -785,7 +785,7 @@ fn threads_support() {
785785

786786
fn run_path(poisoned: &mut bool, path: &Utf8Path, buf: &[u8]) {
787787
let rdr = std::io::Cursor::new(&buf);
788-
iter_header(Mode::Ui, "ui", poisoned, path, rdr, &mut |_| {});
788+
iter_directives(Mode::Ui, "ui", poisoned, path, rdr, &mut |_| {});
789789
}
790790

791791
#[test]

src/tools/compiletest/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use crate::common::{
4242
CompareMode, Config, Debugger, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path,
4343
output_base_dir, output_relative_path,
4444
};
45-
use crate::directives::HeadersCache;
45+
use crate::directives::DirectivesCache;
4646
use crate::executor::{CollectedTest, ColorConfig, OutputFormat};
4747
use crate::util::logv;
4848

@@ -618,7 +618,7 @@ pub fn run_tests(config: Arc<Config>) {
618618
/// Read-only context data used during test collection.
619619
struct TestCollectorCx {
620620
config: Arc<Config>,
621-
cache: HeadersCache,
621+
cache: DirectivesCache,
622622
common_inputs_stamp: Stamp,
623623
modified_tests: Vec<Utf8PathBuf>,
624624
}
@@ -654,7 +654,7 @@ pub(crate) fn collect_and_make_tests(config: Arc<Config>) -> Vec<CollectedTest>
654654
modified_tests(&config, &config.src_test_suite_root).unwrap_or_else(|err| {
655655
fatal!("modified_tests: {}: {err}", config.src_test_suite_root);
656656
});
657-
let cache = HeadersCache::load(&config);
657+
let cache = DirectivesCache::load(&config);
658658

659659
let cx = TestCollectorCx { config, cache, common_inputs_stamp, modified_tests };
660660
let collector = collect_tests_from_dir(&cx, &cx.config.src_test_suite_root, Utf8Path::new(""))

0 commit comments

Comments
 (0)