File tree Expand file tree Collapse file tree 2 files changed +27
-17
lines changed Expand file tree Collapse file tree 2 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -94,25 +94,26 @@ fn update_lints(update_mode: &UpdateMode) {
94
94
let mut sorted_usable_lints = usable_lints. clone ( ) ;
95
95
sorted_usable_lints. sort_by_key ( |lint| lint. name . clone ( ) ) ;
96
96
97
- std :: fs :: write (
97
+ let mut file_change = replace_region_in_file (
98
98
"../src/lintlist/mod.rs" ,
99
- & format ! (
100
- "\
101
- //! This file is managed by `util/dev update_lints`. Do not edit.
102
-
103
- pub mod lint;
104
- pub use lint::Level;
105
- pub use lint::Lint;
106
- pub use lint::LINT_LEVELS;
107
-
108
- pub const ALL_LINTS: [Lint; {}] = {:#?};\n " ,
109
- sorted_usable_lints. len( ) ,
110
- sorted_usable_lints
111
- ) ,
99
+ "begin lint list" ,
100
+ "end lint list" ,
101
+ false ,
102
+ update_mode == & UpdateMode :: Change ,
103
+ || {
104
+ format ! (
105
+ "pub const ALL_LINTS: [Lint; {}] = {:#?};" ,
106
+ sorted_usable_lints. len( ) ,
107
+ sorted_usable_lints
108
+ )
109
+ . lines ( )
110
+ . map ( ToString :: to_string)
111
+ . collect :: < Vec < _ > > ( )
112
+ } ,
112
113
)
113
- . expect ( "can write to file" ) ;
114
+ . changed ;
114
115
115
- let mut file_change = replace_region_in_file (
116
+ file_change | = replace_region_in_file (
116
117
"../README.md" ,
117
118
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"# ,
118
119
"" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ pub use lint::Level;
5
5
pub use lint:: Lint ;
6
6
pub use lint:: LINT_LEVELS ;
7
7
8
- pub const ALL_LINTS : [ Lint ; 304 ] = [
8
+ // begin lint list, do not remove this comment, it’s used in `update_lints`
9
+ pub const ALL_LINTS : [ Lint ; 305 ] = [
9
10
Lint {
10
11
name : "absurd_extreme_comparisons" ,
11
12
group : "correctness" ,
@@ -762,6 +763,13 @@ pub const ALL_LINTS: [Lint; 304] = [
762
763
deprecation : None ,
763
764
module : "arithmetic" ,
764
765
} ,
766
+ Lint {
767
+ name : "integer_division" ,
768
+ group : "pedantic" ,
769
+ desc : "integer division may cause loss of precision" ,
770
+ deprecation : None ,
771
+ module : "integer_division" ,
772
+ } ,
765
773
Lint {
766
774
name : "into_iter_on_array" ,
767
775
group : "correctness" ,
@@ -2135,3 +2143,4 @@ pub const ALL_LINTS: [Lint; 304] = [
2135
2143
module : "unicode" ,
2136
2144
} ,
2137
2145
] ;
2146
+ // end lint list, do not remove this comment, it’s used in `update_lints`
You can’t perform that action at this time.
0 commit comments