Skip to content

Commit b505e94

Browse files
committed
Auto merge of #7773 - Manishearth:update-lints-mods, r=flip1995
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.
2 parents b9dedf3 + d9488c5 commit b505e94

File tree

3 files changed

+248
-240
lines changed

3 files changed

+248
-240
lines changed

clippy_dev/src/update_lints.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ pub fn run(update_mode: UpdateMode) {
9898
)
9999
.changed;
100100

101+
// This has to be in lib.rs, otherwise rustfmt doesn't work
102+
file_change |= replace_region_in_file(
103+
Path::new("clippy_lints/src/lib.rs"),
104+
"begin lints modules",
105+
"end lints modules",
106+
false,
107+
update_mode == UpdateMode::Change,
108+
|| vec![gen_modules_list(usable_lints.iter())],
109+
)
110+
.changed;
111+
101112
if file_change && update_mode == UpdateMode::Check {
102113
exit_with_failure();
103114
}
@@ -112,11 +123,6 @@ pub fn run(update_mode: UpdateMode) {
112123
update_mode,
113124
&gen_deprecated(deprecated_lints.iter()),
114125
);
115-
process_file(
116-
"clippy_lints/src/lib.mods.rs",
117-
update_mode,
118-
&gen_modules_list(usable_lints.iter()),
119-
);
120126

121127
let all_group_lints = usable_lints.iter().filter(|l| {
122128
matches!(

clippy_lints/src/lib.mods.rs

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)