1
- // warn on lints, that are included in `rust-lang/rust`s bootstrap
2
- #![ warn( rust_2018_idioms, unused_lifetimes) ]
3
-
4
1
#[ macro_export]
5
2
#[ allow( clippy:: crate_in_macro_def) ]
6
3
macro_rules! declare_clippy_lint {
7
4
( @
8
- // $(#[$($attrss:tt)*])*
9
5
$( #[ doc = $lit: literal] ) *
10
6
pub $lint_name: ident,
11
7
$category: ident,
@@ -17,19 +13,19 @@ macro_rules! declare_clippy_lint {
17
13
rustc_session:: declare_tool_lint! {
18
14
$( #[ doc = $lit] ) *
19
15
#[ clippy:: version = $version_lit]
20
- pub clippy:: $lint_name, $category, $desc,
21
- report_in_external_macro: true
16
+ pub clippy:: $lint_name,
17
+ $category,
18
+ $desc,
19
+ report_in_external_macro: true
22
20
}
23
21
24
- $crate:: paste:: paste! {
25
- pub ( crate ) static ${ concat( $lint_name, _INFO) } : & ' static crate :: LintInfo = & crate :: LintInfo {
26
- lint: & $lint_name,
27
- category: $lintcategory,
28
- explanation: concat!( $( $lit, "\n " , ) * ) ,
29
- location: concat!( file!( ) , "#L" , line!( ) ) ,
30
- version: $version_expr
31
- } ;
32
- }
22
+ pub ( crate ) static ${ concat( $lint_name, _INFO) } : & ' static crate :: LintInfo = & crate :: LintInfo {
23
+ lint: & $lint_name,
24
+ category: $lintcategory,
25
+ explanation: concat!( $( $lit, "\n " , ) * ) ,
26
+ location: concat!( file!( ) , "#L" , line!( ) ) ,
27
+ version: $version_expr
28
+ } ;
33
29
} ;
34
30
(
35
31
$( #[ doc = $lit: literal] ) *
@@ -40,7 +36,7 @@ macro_rules! declare_clippy_lint {
40
36
) => {
41
37
declare_clippy_lint! { @
42
38
$( #[ doc = $lit] ) *
43
- pub $lint_name, Allow , crate :: LintCategory :: Restriction , $desc,
39
+ pub $lint_name, Allow , crate :: LintCategory :: Restriction , $desc,
44
40
declare_clippy_lint!( __version = $version) , $version
45
41
}
46
42
} ;
@@ -53,7 +49,7 @@ macro_rules! declare_clippy_lint {
53
49
) => {
54
50
declare_clippy_lint! { @
55
51
$( #[ doc = $lit] ) *
56
- pub $lint_name, Warn , crate :: LintCategory :: Style , $desc,
52
+ pub $lint_name, Warn , crate :: LintCategory :: Style , $desc,
57
53
declare_clippy_lint!( __version = $version) , $version
58
54
59
55
}
@@ -67,7 +63,7 @@ macro_rules! declare_clippy_lint {
67
63
) => {
68
64
declare_clippy_lint! { @
69
65
$( #[ doc = $lit] ) *
70
- pub $lint_name, Deny , crate :: LintCategory :: Correctness , $desc,
66
+ pub $lint_name, Deny , crate :: LintCategory :: Correctness , $desc,
71
67
declare_clippy_lint!( __version = $version) , $version
72
68
73
69
}
@@ -81,7 +77,7 @@ macro_rules! declare_clippy_lint {
81
77
) => {
82
78
declare_clippy_lint! { @
83
79
$( #[ doc = $lit] ) *
84
- pub $lint_name, Warn , crate :: LintCategory :: Perf , $desc,
80
+ pub $lint_name, Warn , crate :: LintCategory :: Perf , $desc,
85
81
declare_clippy_lint!( __version = $version) , $version
86
82
}
87
83
} ;
@@ -94,7 +90,7 @@ macro_rules! declare_clippy_lint {
94
90
) => {
95
91
declare_clippy_lint! { @
96
92
$( #[ doc = $lit] ) *
97
- pub $lint_name, Warn , crate :: LintCategory :: Complexity , $desc,
93
+ pub $lint_name, Warn , crate :: LintCategory :: Complexity , $desc,
98
94
declare_clippy_lint!( __version = $version) , $version
99
95
}
100
96
} ;
@@ -107,7 +103,7 @@ macro_rules! declare_clippy_lint {
107
103
) => {
108
104
declare_clippy_lint! { @
109
105
$( #[ doc = $lit] ) *
110
- pub $lint_name, Warn , crate :: LintCategory :: Suspicious , $desc,
106
+ pub $lint_name, Warn , crate :: LintCategory :: Suspicious , $desc,
111
107
declare_clippy_lint!( __version = $version) , $version
112
108
}
113
109
} ;
@@ -120,7 +116,7 @@ macro_rules! declare_clippy_lint {
120
116
) => {
121
117
declare_clippy_lint! { @
122
118
$( #[ doc = $lit] ) *
123
- pub $lint_name, Allow , crate :: LintCategory :: Nursery , $desc,
119
+ pub $lint_name, Allow , crate :: LintCategory :: Nursery , $desc,
124
120
declare_clippy_lint!( __version = $version) , $version
125
121
}
126
122
} ;
@@ -133,7 +129,7 @@ macro_rules! declare_clippy_lint {
133
129
) => {
134
130
declare_clippy_lint! { @
135
131
$( #[ doc = $lit] ) *
136
- pub $lint_name, Allow , crate :: LintCategory :: Pedantic , $desc,
132
+ pub $lint_name, Allow , crate :: LintCategory :: Pedantic , $desc,
137
133
declare_clippy_lint!( __version = $version) , $version
138
134
}
139
135
} ;
@@ -146,7 +142,7 @@ macro_rules! declare_clippy_lint {
146
142
) => {
147
143
declare_clippy_lint! { @
148
144
$( #[ doc = $lit] ) *
149
- pub $lint_name, Allow , crate :: LintCategory :: Cargo , $desc,
145
+ pub $lint_name, Allow , crate :: LintCategory :: Cargo , $desc,
150
146
declare_clippy_lint!( __version = $version) , $version
151
147
}
152
148
} ;
@@ -160,8 +156,8 @@ macro_rules! declare_clippy_lint {
160
156
) => {
161
157
declare_clippy_lint! { @
162
158
$( #[ doc = $lit] ) *
163
- pub $lint_name, Allow , crate :: LintCategory :: Internal , $desc,
164
- declare_clippy_lint! ( __version = $ ( $version ) ? ) , "0.0.0"
159
+ pub $lint_name, Allow , crate :: LintCategory :: Internal , $desc,
160
+ None , "0.0.0"
165
161
}
166
162
} ;
167
163
0 commit comments