Skip to content

Commit 0e481b9

Browse files
committed
Return to generating mod declarations in lib.rs
1 parent b9dedf3 commit 0e481b9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
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!(

0 commit comments

Comments
 (0)