File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,17 @@ pub fn run_core(search_paths: SearchPaths,
193
193
let intra_link_resolution_failure_name = lint:: builtin:: INTRA_DOC_LINK_RESOLUTION_FAILURE . name ;
194
194
let warnings_lint_name = lint:: builtin:: WARNINGS . name ;
195
195
let missing_docs = rustc_lint:: builtin:: MISSING_DOCS . name ;
196
+
197
+ // In addition to those specific lints, we also need to whitelist those given through
198
+ // command line, otherwise they'll get ignored and we don't want that.
199
+ let mut whitelisted_lints = vec ! [ warnings_lint_name. to_owned( ) ,
200
+ intra_link_resolution_failure_name. to_owned( ) ,
201
+ missing_docs. to_owned( ) ] ;
202
+
203
+ for ( lint, _) in & cmd_lints {
204
+ whitelisted_lints. push ( lint. clone ( ) ) ;
205
+ }
206
+
196
207
let lints = lint:: builtin:: HardwiredLints . get_lints ( )
197
208
. into_iter ( )
198
209
. chain ( rustc_lint:: SoftLints . get_lints ( ) . into_iter ( ) )
@@ -248,9 +259,7 @@ pub fn run_core(search_paths: SearchPaths,
248
259
. filter_map ( |lint| {
249
260
// We don't want to whitelist *all* lints so let's
250
261
// ignore those ones.
251
- if lint. name == warnings_lint_name ||
252
- lint. name == intra_link_resolution_failure_name ||
253
- lint. name == missing_docs {
262
+ if whitelisted_lints. iter ( ) . any ( |l| & lint. name == l) {
254
263
None
255
264
} else {
256
265
Some ( lint)
You can’t perform that action at this time.
0 commit comments