@@ -25,7 +25,7 @@ use build_helper::git::{get_git_modified_files, get_git_untracked_files};
25
25
use core:: panic;
26
26
use getopts:: Options ;
27
27
use lazycell:: AtomicLazyCell ;
28
- use std:: collections:: BTreeSet ;
28
+ use std:: collections:: HashSet ;
29
29
use std:: ffi:: OsString ;
30
30
use std:: fs;
31
31
use std:: io:: { self , ErrorKind } ;
@@ -415,7 +415,7 @@ pub fn run_tests(config: Arc<Config>) {
415
415
416
416
let mut tests = Vec :: new ( ) ;
417
417
for c in configs {
418
- let mut found_paths = BTreeSet :: new ( ) ;
418
+ let mut found_paths = HashSet :: new ( ) ;
419
419
make_tests ( c, & mut tests, & mut found_paths) ;
420
420
check_overlapping_tests ( & found_paths) ;
421
421
}
@@ -550,7 +550,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
550
550
pub fn make_tests (
551
551
config : Arc < Config > ,
552
552
tests : & mut Vec < test:: TestDescAndFn > ,
553
- found_paths : & mut BTreeSet < PathBuf > ,
553
+ found_paths : & mut HashSet < PathBuf > ,
554
554
) {
555
555
debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
556
556
let inputs = common_inputs_stamp ( & config) ;
@@ -646,7 +646,7 @@ fn collect_tests_from_dir(
646
646
relative_dir_path : & Path ,
647
647
inputs : & Stamp ,
648
648
tests : & mut Vec < test:: TestDescAndFn > ,
649
- found_paths : & mut BTreeSet < PathBuf > ,
649
+ found_paths : & mut HashSet < PathBuf > ,
650
650
modified_tests : & Vec < PathBuf > ,
651
651
poisoned : & mut bool ,
652
652
) -> io:: Result < ( ) > {
@@ -1128,7 +1128,7 @@ fn not_a_digit(c: char) -> bool {
1128
1128
!c. is_digit ( 10 )
1129
1129
}
1130
1130
1131
- fn check_overlapping_tests ( found_paths : & BTreeSet < PathBuf > ) {
1131
+ fn check_overlapping_tests ( found_paths : & HashSet < PathBuf > ) {
1132
1132
let mut collisions = Vec :: new ( ) ;
1133
1133
for path in found_paths {
1134
1134
for ancestor in path. ancestors ( ) . skip ( 1 ) {
@@ -1138,6 +1138,7 @@ fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
1138
1138
}
1139
1139
}
1140
1140
if !collisions. is_empty ( ) {
1141
+ collisions. sort ( ) ;
1141
1142
let collisions: String = collisions
1142
1143
. into_iter ( )
1143
1144
. map ( |( path, check_parent) | format ! ( "test {path:?} clashes with {check_parent:?}\n " ) )
0 commit comments