about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-02-19 22:16:53 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2021-02-19 22:16:53 +0100
commit22aeec09e4375268ff9cbd7057d3b57aac47a2c5 (patch)
treec63e3d8a7472aac33465c8edb2abf577528defe8
parent4974734a24fb25eca67c571e1a19c0d1285c2d47 (diff)
downloadrust-22aeec09e4375268ff9cbd7057d3b57aac47a2c5.tar.gz
rust-22aeec09e4375268ff9cbd7057d3b57aac47a2c5.zip
lintcheck: sort crates before linting
-rw-r--r--clippy_dev/src/lintcheck.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/clippy_dev/src/lintcheck.rs b/clippy_dev/src/lintcheck.rs
index 54b543f6f72..fe2614e2de7 100644
--- a/clippy_dev/src/lintcheck.rs
+++ b/clippy_dev/src/lintcheck.rs
@@ -39,7 +39,7 @@ struct TomlCrate {
 
 /// Represents an archive we download from crates.io, or a git repo, or a local repo/folder
 /// Once processed (downloaded/extracted/cloned/copied...), this will be translated into a `Crate`
-#[derive(Debug, Serialize, Deserialize, Eq, Hash, PartialEq)]
+#[derive(Debug, Serialize, Deserialize, Eq, Hash, PartialEq, Ord, PartialOrd)]
 enum CrateSource {
     CratesIo {
         name: String,
@@ -376,6 +376,9 @@ fn read_crates(toml_path: Option<&str>) -> (String, Vec<CrateSource>) {
             unreachable!("Failed to translate TomlCrate into CrateSource!");
         }
     });
+    // sort the crates
+    crate_sources.sort();
+
     (toml_filename, crate_sources)
 }