Skip to content

Commit 3f8d87b

Browse files
committed
Rename found_paths to found_path_stems
1 parent c4c62a5 commit 3f8d87b

File tree

1 file changed

+8
-8
lines changed
  • src/tools/compiletest/src

1 file changed

+8
-8
lines changed

src/tools/compiletest/src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ struct TestCollectorCx {
554554
/// Mutable state used during test collection.
555555
struct TestCollector {
556556
tests: Vec<test::TestDescAndFn>,
557-
found_paths: HashSet<PathBuf>,
557+
found_path_stems: HashSet<PathBuf>,
558558
poisoned: bool,
559559
}
560560

@@ -573,21 +573,21 @@ pub fn collect_and_make_tests(config: Arc<Config>) -> Vec<test::TestDescAndFn> {
573573

574574
let cx = TestCollectorCx { config, cache, common_inputs_stamp, modified_tests };
575575
let mut collector =
576-
TestCollector { tests: vec![], found_paths: HashSet::new(), poisoned: false };
576+
TestCollector { tests: vec![], found_path_stems: HashSet::new(), poisoned: false };
577577

578578
collect_tests_from_dir(&cx, &mut collector, &cx.config.src_base, &PathBuf::new())
579579
.unwrap_or_else(|reason| {
580580
panic!("Could not read tests from {}: {reason}", cx.config.src_base.display())
581581
});
582582

583-
let TestCollector { tests, found_paths, poisoned } = collector;
583+
let TestCollector { tests, found_path_stems, poisoned } = collector;
584584

585585
if poisoned {
586586
eprintln!();
587587
panic!("there are errors in tests");
588588
}
589589

590-
check_overlapping_tests(&found_paths);
590+
check_for_overlapping_test_paths(&found_path_stems);
591591

592592
tests
593593
}
@@ -732,7 +732,7 @@ fn collect_tests_from_dir(
732732

733733
// Record the stem of the test file, to check for overlaps later.
734734
let rel_test_path = relative_dir_path.join(file_path.file_stem().unwrap());
735-
collector.found_paths.insert(rel_test_path);
735+
collector.found_path_stems.insert(rel_test_path);
736736

737737
let paths =
738738
TestPaths { file: file_path, relative_dir: relative_dir_path.to_path_buf() };
@@ -1023,11 +1023,11 @@ fn make_test_closure(
10231023
/// To avoid problems, we forbid test names from overlapping in this way.
10241024
///
10251025
/// See <https://github.com/rust-lang/rust/pull/109509> for more context.
1026-
fn check_overlapping_tests(found_paths: &HashSet<PathBuf>) {
1026+
fn check_for_overlapping_test_paths(found_path_stems: &HashSet<PathBuf>) {
10271027
let mut collisions = Vec::new();
1028-
for path in found_paths {
1028+
for path in found_path_stems {
10291029
for ancestor in path.ancestors().skip(1) {
1030-
if found_paths.contains(ancestor) {
1030+
if found_path_stems.contains(ancestor) {
10311031
collisions.push((path, ancestor));
10321032
}
10331033
}

0 commit comments

Comments
 (0)