@@ -12,7 +12,7 @@ use rustc::lint::{
1212 LintContext , LintPass ,
1313} ;
1414use rustc:: ty;
15- use rustc:: { declare_tool_lint , lint_array } ;
15+ use rustc:: { declare_lint_pass , declare_tool_lint } ;
1616use rustc_errors:: Applicability ;
1717use semver:: Version ;
1818use syntax:: ast:: { AttrStyle , Attribute , Lit , LitKind , MetaItemKind , NestedMetaItem } ;
@@ -187,26 +187,15 @@ declare_clippy_lint! {
187187 "usage of `cfg_attr(rustfmt)` instead of `tool_attributes`"
188188}
189189
190- #[ derive( Copy , Clone ) ]
191- pub struct AttrPass ;
190+ declare_lint_pass ! ( Attributes => [
191+ INLINE_ALWAYS ,
192+ DEPRECATED_SEMVER ,
193+ USELESS_ATTRIBUTE ,
194+ EMPTY_LINE_AFTER_OUTER_ATTR ,
195+ UNKNOWN_CLIPPY_LINTS ,
196+ ] ) ;
192197
193- impl LintPass for AttrPass {
194- fn get_lints ( & self ) -> LintArray {
195- lint_array ! (
196- INLINE_ALWAYS ,
197- DEPRECATED_SEMVER ,
198- USELESS_ATTRIBUTE ,
199- EMPTY_LINE_AFTER_OUTER_ATTR ,
200- UNKNOWN_CLIPPY_LINTS ,
201- )
202- }
203-
204- fn name ( & self ) -> & ' static str {
205- "Attributes"
206- }
207- }
208-
209- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for AttrPass {
198+ impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for Attributes {
210199 fn check_attribute ( & mut self , cx : & LateContext < ' a , ' tcx > , attr : & ' tcx Attribute ) {
211200 if let Some ( items) = & attr. meta_item_list ( ) {
212201 if let Some ( ident) = attr. ident ( ) {
@@ -506,20 +495,9 @@ fn is_present_in_source(cx: &LateContext<'_, '_>, span: Span) -> bool {
506495 true
507496}
508497
509- #[ derive( Copy , Clone ) ]
510- pub struct CfgAttrPass ;
511-
512- impl LintPass for CfgAttrPass {
513- fn get_lints ( & self ) -> LintArray {
514- lint_array ! ( DEPRECATED_CFG_ATTR , )
515- }
516-
517- fn name ( & self ) -> & ' static str {
518- "DeprecatedCfgAttribute"
519- }
520- }
498+ declare_lint_pass ! ( DeprecatedCfgAttribute => [ DEPRECATED_CFG_ATTR ] ) ;
521499
522- impl EarlyLintPass for CfgAttrPass {
500+ impl EarlyLintPass for DeprecatedCfgAttribute {
523501 fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & Attribute ) {
524502 if_chain ! {
525503 // check cfg_attr
0 commit comments