@@ -34,6 +34,8 @@ extern crate rustc_errors;
34
34
#[ allow( unused_extern_crates) ]
35
35
extern crate rustc_hir;
36
36
#[ allow( unused_extern_crates) ]
37
+ extern crate rustc_hir_pretty;
38
+ #[ allow( unused_extern_crates) ]
37
39
extern crate rustc_index;
38
40
#[ allow( unused_extern_crates) ]
39
41
extern crate rustc_infer;
@@ -285,6 +287,7 @@ pub mod ranges;
285
287
pub mod redundant_clone;
286
288
pub mod redundant_field_names;
287
289
pub mod redundant_pattern_matching;
290
+ pub mod redundant_pub_crate;
288
291
pub mod redundant_static_lifetimes;
289
292
pub mod reference;
290
293
pub mod regex;
@@ -323,7 +326,7 @@ pub mod zero_div_zero;
323
326
pub use crate :: utils:: conf:: Conf ;
324
327
325
328
mod reexport {
326
- crate use rustc_ast:: ast:: Name ;
329
+ pub use rustc_ast:: ast:: Name ;
327
330
}
328
331
329
332
/// Register all pre expansion lints
@@ -745,6 +748,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
745
748
& redundant_clone:: REDUNDANT_CLONE ,
746
749
& redundant_field_names:: REDUNDANT_FIELD_NAMES ,
747
750
& redundant_pattern_matching:: REDUNDANT_PATTERN_MATCHING ,
751
+ & redundant_pub_crate:: REDUNDANT_PUB_CRATE ,
748
752
& redundant_static_lifetimes:: REDUNDANT_STATIC_LIFETIMES ,
749
753
& reference:: DEREF_ADDROF ,
750
754
& reference:: REF_IN_DEREF ,
@@ -1021,6 +1025,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1021
1025
store. register_late_pass ( || box wildcard_imports:: WildcardImports ) ;
1022
1026
store. register_early_pass ( || box macro_use:: MacroUseImports ) ;
1023
1027
store. register_late_pass ( || box verbose_file_reads:: VerboseFileReads ) ;
1028
+ store. register_late_pass ( || box redundant_pub_crate:: RedundantPubCrate :: default ( ) ) ;
1024
1029
1025
1030
store. register_group ( true , "clippy::restriction" , Some ( "clippy_restriction" ) , vec ! [
1026
1031
LintId :: of( & arithmetic:: FLOAT_ARITHMETIC ) ,
@@ -1059,6 +1064,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1059
1064
LintId :: of( & shadow:: SHADOW_REUSE ) ,
1060
1065
LintId :: of( & shadow:: SHADOW_SAME ) ,
1061
1066
LintId :: of( & strings:: STRING_ADD ) ,
1067
+ LintId :: of( & verbose_file_reads:: VERBOSE_FILE_READS ) ,
1062
1068
LintId :: of( & write:: PRINT_STDOUT ) ,
1063
1069
LintId :: of( & write:: USE_DEBUG ) ,
1064
1070
] ) ;
@@ -1351,7 +1357,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1351
1357
LintId :: of( & transmute:: TRANSMUTE_PTR_TO_PTR ) ,
1352
1358
LintId :: of( & transmute:: TRANSMUTE_PTR_TO_REF ) ,
1353
1359
LintId :: of( & transmute:: UNSOUND_COLLECTION_TRANSMUTE ) ,
1354
- LintId :: of( & transmute:: USELESS_TRANSMUTE ) ,
1355
1360
LintId :: of( & transmute:: WRONG_TRANSMUTE ) ,
1356
1361
LintId :: of( & transmuting_null:: TRANSMUTING_NULL ) ,
1357
1362
LintId :: of( & trivially_copy_pass_by_ref:: TRIVIALLY_COPY_PASS_BY_REF ) ,
@@ -1378,7 +1383,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1378
1383
LintId :: of( & unwrap:: PANICKING_UNWRAP ) ,
1379
1384
LintId :: of( & unwrap:: UNNECESSARY_UNWRAP ) ,
1380
1385
LintId :: of( & vec:: USELESS_VEC ) ,
1381
- LintId :: of( & verbose_file_reads:: VERBOSE_FILE_READS ) ,
1382
1386
LintId :: of( & write:: PRINTLN_EMPTY_STRING ) ,
1383
1387
LintId :: of( & write:: PRINT_LITERAL ) ,
1384
1388
LintId :: of( & write:: PRINT_WITH_NEWLINE ) ,
@@ -1553,7 +1557,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1553
1557
LintId :: of( & transmute:: TRANSMUTE_INT_TO_FLOAT ) ,
1554
1558
LintId :: of( & transmute:: TRANSMUTE_PTR_TO_PTR ) ,
1555
1559
LintId :: of( & transmute:: TRANSMUTE_PTR_TO_REF ) ,
1556
- LintId :: of( & transmute:: USELESS_TRANSMUTE ) ,
1557
1560
LintId :: of( & types:: BORROWED_BOX ) ,
1558
1561
LintId :: of( & types:: CHAR_LIT_AS_U8 ) ,
1559
1562
LintId :: of( & types:: OPTION_OPTION ) ,
@@ -1562,7 +1565,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1562
1565
LintId :: of( & types:: UNNECESSARY_CAST ) ,
1563
1566
LintId :: of( & types:: VEC_BOX ) ,
1564
1567
LintId :: of( & unwrap:: UNNECESSARY_UNWRAP ) ,
1565
- LintId :: of( & verbose_file_reads:: VERBOSE_FILE_READS ) ,
1566
1568
LintId :: of( & zero_div_zero:: ZERO_DIVIDED_BY_ZERO ) ,
1567
1569
] ) ;
1568
1570
@@ -1670,6 +1672,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1670
1672
LintId :: of( & mutex_atomic:: MUTEX_INTEGER ) ,
1671
1673
LintId :: of( & needless_borrow:: NEEDLESS_BORROW ) ,
1672
1674
LintId :: of( & path_buf_push_overwrite:: PATH_BUF_PUSH_OVERWRITE ) ,
1675
+ LintId :: of( & redundant_pub_crate:: REDUNDANT_PUB_CRATE ) ,
1676
+ LintId :: of( & transmute:: USELESS_TRANSMUTE ) ,
1673
1677
LintId :: of( & use_self:: USE_SELF ) ,
1674
1678
] ) ;
1675
1679
}
0 commit comments