Skip to content

Commit

Permalink
Auto merge of rust-lang#9509 - schubart:fix_sorting, r=llogiq
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Oct 2, 2022
2 parents 64243c6 + 033dae9 commit cb8da67
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clippy_dev/src/update_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ fn generate_lint_files(
renamed_lints: &[RenamedLint],
) {
let internal_lints = Lint::internal_lints(lints);
let usable_lints = Lint::usable_lints(lints);
let mut sorted_usable_lints = usable_lints.clone();
sorted_usable_lints.sort_by_key(|lint| lint.name.clone());
let mut usable_lints = Lint::usable_lints(lints);
usable_lints.sort_by_key(|lint| lint.name.clone());

replace_region_in_file(
update_mode,
Expand Down

0 comments on commit cb8da67

Please sign in to comment.