@@ -286,14 +286,14 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
286
286
} ,
287
287
_ => { } ,
288
288
}
289
- if items. is_empty ( ) || !attr. check_name ( sym ! ( deprecated) ) {
289
+ if items. is_empty ( ) || !attr. has_name ( sym ! ( deprecated) ) {
290
290
return ;
291
291
}
292
292
for item in items {
293
293
if_chain ! {
294
294
if let NestedMetaItem :: MetaItem ( mi) = & item;
295
295
if let MetaItemKind :: NameValue ( lit) = & mi. kind;
296
- if mi. check_name ( sym!( since) ) ;
296
+ if mi. has_name ( sym!( since) ) ;
297
297
then {
298
298
check_semver( cx, item. span( ) , lit) ;
299
299
}
@@ -309,7 +309,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
309
309
}
310
310
match item. kind {
311
311
ItemKind :: ExternCrate ( ..) | ItemKind :: Use ( ..) => {
312
- let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. check_name ( sym ! ( macro_use) ) ) ;
312
+ let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. has_name ( sym ! ( macro_use) ) ) ;
313
313
314
314
for attr in item. attrs {
315
315
if in_external_macro ( cx. sess ( ) , attr. span ) {
@@ -524,7 +524,7 @@ fn check_attrs(cx: &LateContext<'_>, span: Span, name: Name, attrs: &[Attribute]
524
524
525
525
for attr in attrs {
526
526
if let Some ( values) = attr. meta_item_list ( ) {
527
- if values. len ( ) != 1 || !attr. check_name ( sym ! ( inline) ) {
527
+ if values. len ( ) != 1 || !attr. has_name ( sym ! ( inline) ) {
528
528
continue ;
529
529
}
530
530
if is_word ( & values[ 0 ] , sym ! ( always) ) {
@@ -558,7 +558,7 @@ fn check_semver(cx: &LateContext<'_>, span: Span, lit: &Lit) {
558
558
559
559
fn is_word ( nmi : & NestedMetaItem , expected : Symbol ) -> bool {
560
560
if let NestedMetaItem :: MetaItem ( mi) = & nmi {
561
- mi. is_word ( ) && mi. check_name ( expected)
561
+ mi. is_word ( ) && mi. has_name ( expected)
562
562
} else {
563
563
false
564
564
}
@@ -618,15 +618,15 @@ fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::as
618
618
fn check_deprecated_cfg_attr ( cx : & EarlyContext < ' _ > , attr : & Attribute ) {
619
619
if_chain ! {
620
620
// check cfg_attr
621
- if attr. check_name ( sym!( cfg_attr) ) ;
621
+ if attr. has_name ( sym!( cfg_attr) ) ;
622
622
if let Some ( items) = attr. meta_item_list( ) ;
623
623
if items. len( ) == 2 ;
624
624
// check for `rustfmt`
625
625
if let Some ( feature_item) = items[ 0 ] . meta_item( ) ;
626
- if feature_item. check_name ( sym!( rustfmt) ) ;
626
+ if feature_item. has_name ( sym!( rustfmt) ) ;
627
627
// check for `rustfmt_skip` and `rustfmt::skip`
628
628
if let Some ( skip_item) = & items[ 1 ] . meta_item( ) ;
629
- if skip_item. check_name ( sym!( rustfmt_skip) ) ||
629
+ if skip_item. has_name ( sym!( rustfmt_skip) ) ||
630
630
skip_item. path. segments. last( ) . expect( "empty path in attribute" ) . ident. name == sym!( skip) ;
631
631
// Only lint outer attributes, because custom inner attributes are unstable
632
632
// Tracking issue: https://github.com/rust-lang/rust/issues/54726
@@ -685,7 +685,7 @@ fn check_mismatched_target_os(cx: &EarlyContext<'_>, attr: &Attribute) {
685
685
}
686
686
687
687
if_chain ! {
688
- if attr. check_name ( sym!( cfg) ) ;
688
+ if attr. has_name ( sym!( cfg) ) ;
689
689
if let Some ( list) = attr. meta_item_list( ) ;
690
690
let mismatched = find_mismatched_target_os( & list) ;
691
691
if !mismatched. is_empty( ) ;
0 commit comments