@@ -554,7 +554,7 @@ struct TestCollectorCx {
554
554
/// Mutable state used during test collection.
555
555
struct TestCollector {
556
556
tests : Vec < test:: TestDescAndFn > ,
557
- found_paths : HashSet < PathBuf > ,
557
+ found_path_stems : HashSet < PathBuf > ,
558
558
poisoned : bool ,
559
559
}
560
560
@@ -573,21 +573,21 @@ pub fn collect_and_make_tests(config: Arc<Config>) -> Vec<test::TestDescAndFn> {
573
573
574
574
let cx = TestCollectorCx { config, cache, common_inputs_stamp, modified_tests } ;
575
575
let mut collector =
576
- TestCollector { tests : vec ! [ ] , found_paths : HashSet :: new ( ) , poisoned : false } ;
576
+ TestCollector { tests : vec ! [ ] , found_path_stems : HashSet :: new ( ) , poisoned : false } ;
577
577
578
578
collect_tests_from_dir ( & cx, & mut collector, & cx. config . src_base , & PathBuf :: new ( ) )
579
579
. unwrap_or_else ( |reason| {
580
580
panic ! ( "Could not read tests from {}: {reason}" , cx. config. src_base. display( ) )
581
581
} ) ;
582
582
583
- let TestCollector { tests, found_paths , poisoned } = collector;
583
+ let TestCollector { tests, found_path_stems , poisoned } = collector;
584
584
585
585
if poisoned {
586
586
eprintln ! ( ) ;
587
587
panic ! ( "there are errors in tests" ) ;
588
588
}
589
589
590
- check_overlapping_tests ( & found_paths ) ;
590
+ check_for_overlapping_test_paths ( & found_path_stems ) ;
591
591
592
592
tests
593
593
}
@@ -732,7 +732,7 @@ fn collect_tests_from_dir(
732
732
733
733
// Record the stem of the test file, to check for overlaps later.
734
734
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) ;
736
736
737
737
let paths =
738
738
TestPaths { file : file_path, relative_dir : relative_dir_path. to_path_buf ( ) } ;
@@ -1023,11 +1023,11 @@ fn make_test_closure(
1023
1023
/// To avoid problems, we forbid test names from overlapping in this way.
1024
1024
///
1025
1025
/// 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 > ) {
1027
1027
let mut collisions = Vec :: new ( ) ;
1028
- for path in found_paths {
1028
+ for path in found_path_stems {
1029
1029
for ancestor in path. ancestors ( ) . skip ( 1 ) {
1030
- if found_paths . contains ( ancestor) {
1030
+ if found_path_stems . contains ( ancestor) {
1031
1031
collisions. push ( ( path, ancestor) ) ;
1032
1032
}
1033
1033
}
0 commit comments