diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-18 13:32:29 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-18 16:05:57 +1100 |
| commit | 3f8d87beda3f615f1df19504f908fbe9e5824b83 (patch) | |
| tree | fee170f16b1b1a14808e6afff2f140da599f920f | |
| parent | c4c62a5591bdaa061ef6bab7fc18b29ff02a00c4 (diff) | |
| download | rust-3f8d87beda3f615f1df19504f908fbe9e5824b83.tar.gz rust-3f8d87beda3f615f1df19504f908fbe9e5824b83.zip | |
Rename `found_paths` to `found_path_stems`
| -rw-r--r-- | src/tools/compiletest/src/lib.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 5c148e37143..9962487ef81 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -554,7 +554,7 @@ struct TestCollectorCx { /// Mutable state used during test collection. struct TestCollector { tests: Vec<test::TestDescAndFn>, - found_paths: HashSet<PathBuf>, + found_path_stems: HashSet<PathBuf>, poisoned: bool, } @@ -573,21 +573,21 @@ pub fn collect_and_make_tests(config: Arc<Config>) -> Vec<test::TestDescAndFn> { let cx = TestCollectorCx { config, cache, common_inputs_stamp, modified_tests }; let mut collector = - TestCollector { tests: vec![], found_paths: HashSet::new(), poisoned: false }; + TestCollector { tests: vec![], found_path_stems: HashSet::new(), poisoned: false }; collect_tests_from_dir(&cx, &mut collector, &cx.config.src_base, &PathBuf::new()) .unwrap_or_else(|reason| { panic!("Could not read tests from {}: {reason}", cx.config.src_base.display()) }); - let TestCollector { tests, found_paths, poisoned } = collector; + let TestCollector { tests, found_path_stems, poisoned } = collector; if poisoned { eprintln!(); panic!("there are errors in tests"); } - check_overlapping_tests(&found_paths); + check_for_overlapping_test_paths(&found_path_stems); tests } @@ -732,7 +732,7 @@ fn collect_tests_from_dir( // Record the stem of the test file, to check for overlaps later. let rel_test_path = relative_dir_path.join(file_path.file_stem().unwrap()); - collector.found_paths.insert(rel_test_path); + collector.found_path_stems.insert(rel_test_path); let paths = TestPaths { file: file_path, relative_dir: relative_dir_path.to_path_buf() }; @@ -1023,11 +1023,11 @@ fn make_test_closure( /// To avoid problems, we forbid test names from overlapping in this way. /// /// See <https://github.com/rust-lang/rust/pull/109509> for more context. -fn check_overlapping_tests(found_paths: &HashSet<PathBuf>) { +fn check_for_overlapping_test_paths(found_path_stems: &HashSet<PathBuf>) { let mut collisions = Vec::new(); - for path in found_paths { + for path in found_path_stems { for ancestor in path.ancestors().skip(1) { - if found_paths.contains(ancestor) { + if found_path_stems.contains(ancestor) { collisions.push((path, ancestor)); } } |
