diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-06 00:12:38 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-06 00:12:38 -0700 |
| commit | 0e481b94520a0a084325f38e49b28904829e1759 (patch) | |
| tree | 72afdf8013cdd72b662fc4188361f534a60d35ce | |
| parent | b9dedf395918275aa09710d2f51f62a1285bc035 (diff) | |
| download | rust-0e481b94520a0a084325f38e49b28904829e1759.tar.gz rust-0e481b94520a0a084325f38e49b28904829e1759.zip | |
Return to generating mod declarations in lib.rs
| -rw-r--r-- | clippy_dev/src/update_lints.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index 1ab8ad9b920..6ec812909f2 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -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!( |
