]> git.lizzy.rs Git - rust.git/commitdiff
Return to generating mod declarations in lib.rs
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 6 Oct 2021 07:12:38 +0000 (00:12 -0700)
committerManish Goregaokar <manishsmail@gmail.com>
Wed, 6 Oct 2021 07:12:38 +0000 (00:12 -0700)
clippy_dev/src/update_lints.rs

index 1ab8ad9b9207b90aff44d66b63f5ef1bd6094ec0..6ec812909f2b59713f03058c79a4bca8196d5128 100644 (file)
@@ -98,6 +98,17 @@ pub fn run(update_mode: UpdateMode) {
     )
     .changed;
 
+    // This has to be in lib.rs, otherwise rustfmt doesn't work
+    file_change |= replace_region_in_file(
+        Path::new("clippy_lints/src/lib.rs"),
+        "begin lints modules",
+        "end lints modules",
+        false,
+        update_mode == UpdateMode::Change,
+        || vec![gen_modules_list(usable_lints.iter())],
+    )
+    .changed;
+
     if file_change && update_mode == UpdateMode::Check {
         exit_with_failure();
     }
@@ -112,11 +123,6 @@ pub fn run(update_mode: UpdateMode) {
         update_mode,
         &gen_deprecated(deprecated_lints.iter()),
     );
-    process_file(
-        "clippy_lints/src/lib.mods.rs",
-        update_mode,
-        &gen_modules_list(usable_lints.iter()),
-    );
 
     let all_group_lints = usable_lints.iter().filter(|l| {
         matches!(