about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/compiletest/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index 60dd15841b7..543304694f6 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -25,7 +25,7 @@ use build_helper::git::{get_git_modified_files, get_git_untracked_files};
 use core::panic;
 use getopts::Options;
 use lazycell::AtomicLazyCell;
-use std::collections::BTreeSet;
+use std::collections::HashSet;
 use std::ffi::OsString;
 use std::fs;
 use std::io::{self, ErrorKind};
@@ -415,7 +415,7 @@ pub fn run_tests(config: Arc<Config>) {
 
     let mut tests = Vec::new();
     for c in configs {
-        let mut found_paths = BTreeSet::new();
+        let mut found_paths = HashSet::new();
         make_tests(c, &mut tests, &mut found_paths);
         check_overlapping_tests(&found_paths);
     }
@@ -550,7 +550,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
 pub fn make_tests(
     config: Arc<Config>,
     tests: &mut Vec<test::TestDescAndFn>,
-    found_paths: &mut BTreeSet<PathBuf>,
+    found_paths: &mut HashSet<PathBuf>,
 ) {
     debug!("making tests from {:?}", config.src_base.display());
     let inputs = common_inputs_stamp(&config);
@@ -646,7 +646,7 @@ fn collect_tests_from_dir(
     relative_dir_path: &Path,
     inputs: &Stamp,
     tests: &mut Vec<test::TestDescAndFn>,
-    found_paths: &mut BTreeSet<PathBuf>,
+    found_paths: &mut HashSet<PathBuf>,
     modified_tests: &Vec<PathBuf>,
     poisoned: &mut bool,
 ) -> io::Result<()> {
@@ -1128,7 +1128,7 @@ fn not_a_digit(c: char) -> bool {
     !c.is_digit(10)
 }
 
-fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
+fn check_overlapping_tests(found_paths: &HashSet<PathBuf>) {
     let mut collisions = Vec::new();
     for path in found_paths {
         for ancestor in path.ancestors().skip(1) {
@@ -1138,6 +1138,7 @@ fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
         }
     }
     if !collisions.is_empty() {
+        collisions.sort();
         let collisions: String = collisions
             .into_iter()
             .map(|(path, check_parent)| format!("test {path:?} clashes with {check_parent:?}\n"))