Skip to content

Commit cb8da67

Browse files
committed
Auto merge of rust-lang#9509 - schubart:fix_sorting, r=llogiq
Fix sorting in ` cargo dev update_lints` script changelog: none The old code cloned and sorted `usable_lints` into `sorted_usable_lints`, but then failed to do anything with `sorted_usable_lints`. This was discovered by my new `collection_is_never_read` lint (rust-lang#9267) that I'm working on! Fix: I renamed the sorted vector to `usable_lints`. Therefore it now gets used where the unsorted one was used previously.
2 parents 64243c6 + 033dae9 commit cb8da67

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clippy_dev/src/update_lints.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ fn generate_lint_files(
4545
renamed_lints: &[RenamedLint],
4646
) {
4747
let internal_lints = Lint::internal_lints(lints);
48-
let usable_lints = Lint::usable_lints(lints);
49-
let mut sorted_usable_lints = usable_lints.clone();
50-
sorted_usable_lints.sort_by_key(|lint| lint.name.clone());
48+
let mut usable_lints = Lint::usable_lints(lints);
49+
usable_lints.sort_by_key(|lint| lint.name.clone());
5150

5251
replace_region_in_file(
5352
update_mode,

0 commit comments

Comments
 (0)