1- // warn on lints, that are included in `rust-lang/rust`s bootstrap
2- #![ warn( rust_2018_idioms, unused_lifetimes) ]
3-
41#[ macro_export]
52#[ allow( clippy:: crate_in_macro_def) ]
63macro_rules! declare_clippy_lint {
74 ( @
8- // $(#[$($attrss:tt)*])*
95 $( #[ doc = $lit: literal] ) *
106 pub $lint_name: ident,
117 $category: ident,
@@ -17,19 +13,19 @@ macro_rules! declare_clippy_lint {
1713 rustc_session:: declare_tool_lint! {
1814 $( #[ doc = $lit] ) *
1915 #[ 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
2220 }
2321
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+ } ;
3329 } ;
3430 (
3531 $( #[ doc = $lit: literal] ) *
@@ -40,7 +36,7 @@ macro_rules! declare_clippy_lint {
4036 ) => {
4137 declare_clippy_lint! { @
4238 $( #[ doc = $lit] ) *
43- pub $lint_name, Allow , crate :: LintCategory :: Restriction , $desc,
39+ pub $lint_name, Allow , crate :: LintCategory :: Restriction , $desc,
4440 declare_clippy_lint!( __version = $version) , $version
4541 }
4642 } ;
@@ -53,7 +49,7 @@ macro_rules! declare_clippy_lint {
5349 ) => {
5450 declare_clippy_lint! { @
5551 $( #[ doc = $lit] ) *
56- pub $lint_name, Warn , crate :: LintCategory :: Style , $desc,
52+ pub $lint_name, Warn , crate :: LintCategory :: Style , $desc,
5753 declare_clippy_lint!( __version = $version) , $version
5854
5955 }
@@ -67,7 +63,7 @@ macro_rules! declare_clippy_lint {
6763 ) => {
6864 declare_clippy_lint! { @
6965 $( #[ doc = $lit] ) *
70- pub $lint_name, Deny , crate :: LintCategory :: Correctness , $desc,
66+ pub $lint_name, Deny , crate :: LintCategory :: Correctness , $desc,
7167 declare_clippy_lint!( __version = $version) , $version
7268
7369 }
@@ -81,7 +77,7 @@ macro_rules! declare_clippy_lint {
8177 ) => {
8278 declare_clippy_lint! { @
8379 $( #[ doc = $lit] ) *
84- pub $lint_name, Warn , crate :: LintCategory :: Perf , $desc,
80+ pub $lint_name, Warn , crate :: LintCategory :: Perf , $desc,
8581 declare_clippy_lint!( __version = $version) , $version
8682 }
8783 } ;
@@ -94,7 +90,7 @@ macro_rules! declare_clippy_lint {
9490 ) => {
9591 declare_clippy_lint! { @
9692 $( #[ doc = $lit] ) *
97- pub $lint_name, Warn , crate :: LintCategory :: Complexity , $desc,
93+ pub $lint_name, Warn , crate :: LintCategory :: Complexity , $desc,
9894 declare_clippy_lint!( __version = $version) , $version
9995 }
10096 } ;
@@ -107,7 +103,7 @@ macro_rules! declare_clippy_lint {
107103 ) => {
108104 declare_clippy_lint! { @
109105 $( #[ doc = $lit] ) *
110- pub $lint_name, Warn , crate :: LintCategory :: Suspicious , $desc,
106+ pub $lint_name, Warn , crate :: LintCategory :: Suspicious , $desc,
111107 declare_clippy_lint!( __version = $version) , $version
112108 }
113109 } ;
@@ -120,7 +116,7 @@ macro_rules! declare_clippy_lint {
120116 ) => {
121117 declare_clippy_lint! { @
122118 $( #[ doc = $lit] ) *
123- pub $lint_name, Allow , crate :: LintCategory :: Nursery , $desc,
119+ pub $lint_name, Allow , crate :: LintCategory :: Nursery , $desc,
124120 declare_clippy_lint!( __version = $version) , $version
125121 }
126122 } ;
@@ -133,7 +129,7 @@ macro_rules! declare_clippy_lint {
133129 ) => {
134130 declare_clippy_lint! { @
135131 $( #[ doc = $lit] ) *
136- pub $lint_name, Allow , crate :: LintCategory :: Pedantic , $desc,
132+ pub $lint_name, Allow , crate :: LintCategory :: Pedantic , $desc,
137133 declare_clippy_lint!( __version = $version) , $version
138134 }
139135 } ;
@@ -146,7 +142,7 @@ macro_rules! declare_clippy_lint {
146142 ) => {
147143 declare_clippy_lint! { @
148144 $( #[ doc = $lit] ) *
149- pub $lint_name, Allow , crate :: LintCategory :: Cargo , $desc,
145+ pub $lint_name, Allow , crate :: LintCategory :: Cargo , $desc,
150146 declare_clippy_lint!( __version = $version) , $version
151147 }
152148 } ;
@@ -160,8 +156,8 @@ macro_rules! declare_clippy_lint {
160156 ) => {
161157 declare_clippy_lint! { @
162158 $( #[ 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"
165161 }
166162 } ;
167163
0 commit comments