Skip to content

Commit

Permalink
Auto merge of #7773 - Manishearth:update-lints-mods, r=flip1995
Browse files Browse the repository at this point in the history
Move module declarations back into lib.rs

With #7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case).

With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs.
  • Loading branch information
bors committed Oct 6, 2021
2 parents b9dedf3 + d9488c5 commit b505e94
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 240 deletions.
16 changes: 11 additions & 5 deletions clippy_dev/src/update_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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!(
Expand Down
234 changes: 0 additions & 234 deletions clippy_lints/src/lib.mods.rs

This file was deleted.

Loading

0 comments on commit b505e94

Please sign in to comment.