1
1
// error-pattern:cargo-clippy
2
2
3
3
#![ feature( bindings_after_at) ]
4
- #![ feature( box_syntax) ]
5
4
#![ feature( box_patterns) ]
5
+ #![ feature( box_syntax) ]
6
+ #![ feature( concat_idents) ]
7
+ #![ feature( crate_visibility_modifier) ]
8
+ #![ feature( drain_filter) ]
6
9
#![ feature( or_patterns) ]
7
10
#![ feature( rustc_private) ]
8
11
#![ feature( stmt_expr_attributes) ]
9
- #![ allow( clippy:: missing_docs_in_private_items, clippy:: must_use_candidate) ]
10
12
#![ recursion_limit = "512" ]
11
- #![ warn( rust_2018_idioms, trivial_casts, trivial_numeric_casts) ]
12
- #![ deny( rustc:: internal) ]
13
13
#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
14
- #![ feature( crate_visibility_modifier) ]
15
- #![ feature( concat_idents) ]
16
- #![ feature( drain_filter) ]
14
+ #![ allow( clippy:: missing_docs_in_private_items, clippy:: must_use_candidate) ]
15
+ #![ warn( trivial_casts, trivial_numeric_casts) ]
16
+ // warn on lints, that are included in `rust-lang/rust`s bootstrap
17
+ #![ warn( rust_2018_idioms, unused_lifetimes) ]
18
+ // warn on rustc internal lints
19
+ #![ deny( rustc:: internal) ]
17
20
18
21
// FIXME: switch to something more ergonomic here, once available.
19
22
// (Currently there is no way to opt into sysroot crates without `extern crate`.)
20
- #[ allow( unused_extern_crates) ]
21
23
extern crate rustc_ast;
22
- #[ allow( unused_extern_crates) ]
23
24
extern crate rustc_ast_pretty;
24
- #[ allow( unused_extern_crates) ]
25
25
extern crate rustc_attr;
26
- #[ allow( unused_extern_crates) ]
27
26
extern crate rustc_data_structures;
28
- #[ allow( unused_extern_crates) ]
29
- extern crate rustc_driver;
30
- #[ allow( unused_extern_crates) ]
31
27
extern crate rustc_errors;
32
- #[ allow( unused_extern_crates) ]
33
28
extern crate rustc_hir;
34
- #[ allow( unused_extern_crates) ]
35
29
extern crate rustc_hir_pretty;
36
- #[ allow( unused_extern_crates) ]
37
30
extern crate rustc_index;
38
- #[ allow( unused_extern_crates) ]
39
31
extern crate rustc_infer;
40
- #[ allow( unused_extern_crates) ]
41
32
extern crate rustc_lexer;
42
- #[ allow( unused_extern_crates) ]
43
33
extern crate rustc_lint;
44
- #[ allow( unused_extern_crates) ]
45
34
extern crate rustc_middle;
46
- #[ allow( unused_extern_crates) ]
47
35
extern crate rustc_mir;
48
- #[ allow( unused_extern_crates) ]
49
36
extern crate rustc_parse;
50
- #[ allow( unused_extern_crates) ]
51
37
extern crate rustc_parse_format;
52
- #[ allow( unused_extern_crates) ]
53
38
extern crate rustc_session;
54
- #[ allow( unused_extern_crates) ]
55
39
extern crate rustc_span;
56
- #[ allow( unused_extern_crates) ]
57
40
extern crate rustc_target;
58
- #[ allow( unused_extern_crates) ]
59
41
extern crate rustc_trait_selection;
60
- #[ allow( unused_extern_crates) ]
61
42
extern crate rustc_typeck;
62
43
63
44
use rustc_data_structures:: fx:: FxHashSet ;
@@ -82,14 +63,10 @@ use rustc_session::Session;
82
63
/// # Example
83
64
///
84
65
/// ```
85
- /// # #![feature(rustc_private)]
86
- /// # #[allow(unused_extern_crates)]
87
- /// # extern crate rustc_middle;
88
- /// # #[allow(unused_extern_crates)]
89
- /// # extern crate rustc_session;
90
- /// # #[macro_use]
91
- /// # use clippy_lints::declare_clippy_lint;
66
+ /// #![feature(rustc_private)]
67
+ /// extern crate rustc_session;
92
68
/// use rustc_session::declare_tool_lint;
69
+ /// use clippy_lints::declare_clippy_lint;
93
70
///
94
71
/// declare_clippy_lint! {
95
72
/// /// **What it does:** Checks for ... (describe what the lint matches).
@@ -1062,7 +1039,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1062
1039
store. register_early_pass ( || box option_env_unwrap:: OptionEnvUnwrap ) ;
1063
1040
let warn_on_all_wildcard_imports = conf. warn_on_all_wildcard_imports ;
1064
1041
store. register_late_pass ( move || box wildcard_imports:: WildcardImports :: new ( warn_on_all_wildcard_imports) ) ;
1065
- store. register_early_pass ( || box macro_use:: MacroUseImports ) ;
1066
1042
store. register_late_pass ( || box verbose_file_reads:: VerboseFileReads ) ;
1067
1043
store. register_late_pass ( || box redundant_pub_crate:: RedundantPubCrate :: default ( ) ) ;
1068
1044
store. register_late_pass ( || box unnamed_address:: UnnamedAddress ) ;
@@ -1080,6 +1056,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1080
1056
single_char_binding_names_threshold,
1081
1057
} ) ;
1082
1058
store. register_early_pass ( || box unnested_or_patterns:: UnnestedOrPatterns ) ;
1059
+ store. register_late_pass ( || box macro_use:: MacroUseImports :: default ( ) ) ;
1083
1060
1084
1061
store. register_group ( true , "clippy::restriction" , Some ( "clippy_restriction" ) , vec ! [
1085
1062
LintId :: of( & arithmetic:: FLOAT_ARITHMETIC ) ,
@@ -1187,6 +1164,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1187
1164
LintId :: of( & types:: OPTION_OPTION ) ,
1188
1165
LintId :: of( & unicode:: NON_ASCII_LITERAL ) ,
1189
1166
LintId :: of( & unicode:: UNICODE_NOT_NFC ) ,
1167
+ LintId :: of( & unnested_or_patterns:: UNNESTED_OR_PATTERNS ) ,
1190
1168
LintId :: of( & unused_self:: UNUSED_SELF ) ,
1191
1169
LintId :: of( & wildcard_imports:: ENUM_GLOB_USE ) ,
1192
1170
LintId :: of( & wildcard_imports:: WILDCARD_IMPORTS ) ,
@@ -1440,7 +1418,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1440
1418
LintId :: of( & unnamed_address:: FN_ADDRESS_COMPARISONS ) ,
1441
1419
LintId :: of( & unnamed_address:: VTABLE_ADDRESS_COMPARISONS ) ,
1442
1420
LintId :: of( & unnecessary_sort_by:: UNNECESSARY_SORT_BY ) ,
1443
- LintId :: of( & unnested_or_patterns:: UNNESTED_OR_PATTERNS ) ,
1444
1421
LintId :: of( & unsafe_removed_from_name:: UNSAFE_REMOVED_FROM_NAME ) ,
1445
1422
LintId :: of( & unused_io_amount:: UNUSED_IO_AMOUNT ) ,
1446
1423
LintId :: of( & unwrap:: PANICKING_UNWRAP ) ,
@@ -1624,7 +1601,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1624
1601
LintId :: of( & types:: UNNECESSARY_CAST ) ,
1625
1602
LintId :: of( & types:: VEC_BOX ) ,
1626
1603
LintId :: of( & unnecessary_sort_by:: UNNECESSARY_SORT_BY ) ,
1627
- LintId :: of( & unnested_or_patterns:: UNNESTED_OR_PATTERNS ) ,
1628
1604
LintId :: of( & unwrap:: UNNECESSARY_UNWRAP ) ,
1629
1605
LintId :: of( & useless_conversion:: USELESS_CONVERSION ) ,
1630
1606
LintId :: of( & zero_div_zero:: ZERO_DIVIDED_BY_ZERO ) ,
0 commit comments