File tree Expand file tree Collapse file tree 2 files changed +1121
-1248
lines changed Expand file tree Collapse file tree 2 files changed +1121
-1248
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,18 @@ fn print_lints() {
8888fn update_lints ( update_mode : & UpdateMode ) {
8989 let lint_list: Vec < Lint > = gather_all ( ) . collect ( ) ;
9090
91+ let usable_lints: Vec < Lint > = Lint :: usable_lints ( lint_list. clone ( ) . into_iter ( ) ) . collect ( ) ;
92+ let lint_count = usable_lints. len ( ) ;
93+
94+ let mut sorted_usable_lints = usable_lints. clone ( ) ;
95+ sorted_usable_lints. sort_by_key ( |lint| lint. name . clone ( ) ) ;
96+
9197 std:: fs:: write (
9298 "../src/lintlist.rs" ,
9399 & format ! (
94100 "\
101+ //! This file is managed by util/dev update_lints. Do not edit.
102+
95103/// Lint data parsed from the Clippy source code.
96104#[derive(Clone, PartialEq, Debug)]
97105pub struct Lint {{
@@ -103,15 +111,12 @@ pub struct Lint {{
103111}}
104112
105113pub const ALL_LINTS: [Lint; {}] = {:#?};\n " ,
106- lint_list . len( ) ,
107- lint_list
114+ sorted_usable_lints . len( ) ,
115+ sorted_usable_lints
108116 ) ,
109117 )
110118 . expect ( "can write to file" ) ;
111119
112- let usable_lints: Vec < Lint > = Lint :: usable_lints ( lint_list. clone ( ) . into_iter ( ) ) . collect ( ) ;
113- let lint_count = usable_lints. len ( ) ;
114-
115120 let mut file_change = replace_region_in_file (
116121 "../README.md" ,
117122 r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"# ,
You can’t perform that action at this time.
0 commit comments