@@ -215,14 +215,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
215215 } ,
216216 _ => { } ,
217217 }
218- if items. is_empty ( ) || attr. name ( ) != "deprecated" {
218+ if items. is_empty ( ) || ! attr. check_name ( "deprecated" ) {
219219 return ;
220220 }
221221 for item in items {
222222 if_chain ! {
223223 if let NestedMetaItem :: MetaItem ( mi) = & item;
224224 if let MetaItemKind :: NameValue ( lit) = & mi. node;
225- if mi. name ( ) == "since" ;
225+ if mi. check_name ( "since" ) ;
226226 then {
227227 check_semver( cx, item. span( ) , lit) ;
228228 }
@@ -238,7 +238,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
238238 }
239239 match item. node {
240240 ItemKind :: ExternCrate ( ..) | ItemKind :: Use ( ..) => {
241- let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. name ( ) == "macro_use" ) ;
241+ let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. check_name ( "macro_use" ) ) ;
242242
243243 for attr in & item. attrs {
244244 if let Some ( lint_list) = & attr. meta_item_list ( ) {
@@ -447,7 +447,7 @@ fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attrib
447447 }
448448
449449 if let Some ( values) = attr. meta_item_list ( ) {
450- if values. len ( ) != 1 || attr. name ( ) != "inline" {
450+ if values. len ( ) != 1 || ! attr. check_name ( "inline" ) {
451451 continue ;
452452 }
453453 if is_word ( & values[ 0 ] , "always" ) {
@@ -481,7 +481,7 @@ fn check_semver(cx: &LateContext<'_, '_>, span: Span, lit: &Lit) {
481481
482482fn is_word ( nmi : & NestedMetaItem , expected : & str ) -> bool {
483483 if let NestedMetaItem :: MetaItem ( mi) = & nmi {
484- mi. is_word ( ) && mi. name ( ) == expected
484+ mi. is_word ( ) && mi. check_name ( expected)
485485 } else {
486486 false
487487 }
@@ -518,15 +518,15 @@ impl EarlyLintPass for CfgAttrPass {
518518 fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & Attribute ) {
519519 if_chain ! {
520520 // check cfg_attr
521- if attr. name ( ) == "cfg_attr" ;
521+ if attr. check_name ( "cfg_attr" ) ;
522522 if let Some ( items) = attr. meta_item_list( ) ;
523523 if items. len( ) == 2 ;
524524 // check for `rustfmt`
525525 if let Some ( feature_item) = items[ 0 ] . meta_item( ) ;
526- if feature_item. name ( ) == "rustfmt" ;
526+ if feature_item. check_name ( "rustfmt" ) ;
527527 // check for `rustfmt_skip` and `rustfmt::skip`
528528 if let Some ( skip_item) = & items[ 1 ] . meta_item( ) ;
529- if skip_item. name ( ) == "rustfmt_skip" || skip_item. name ( ) == "skip" ;
529+ if skip_item. check_name ( "rustfmt_skip" ) || skip_item. check_name ( "skip" ) ;
530530 // Only lint outer attributes, because custom inner attributes are unstable
531531 // Tracking issue: https://github.com/rust-lang/rust/issues/54726
532532 if let AttrStyle :: Outer = attr. style;
0 commit comments