@@ -10,7 +10,7 @@ use clippy_utils::source::{first_line_of_span, is_present_in_source, snippet_opt
10
10
use rustc_ast:: token:: { Token , TokenKind } ;
11
11
use rustc_ast:: tokenstream:: TokenTree ;
12
12
use rustc_ast:: {
13
- AttrArgs , AttrArgsEq , AttrKind , AttrStyle , Attribute , LitKind , MetaItemKind , MetaItemLit , NestedMetaItem ,
13
+ AttrArgs , AttrArgsEq , AttrId , AttrKind , AttrStyle , Attribute , LitKind , MetaItemKind , MetaItemLit , NestedMetaItem ,
14
14
} ;
15
15
use rustc_errors:: Applicability ;
16
16
use rustc_hir:: {
@@ -518,7 +518,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
518
518
fn check_attribute ( & mut self , cx : & LateContext < ' tcx > , attr : & ' tcx Attribute ) {
519
519
if let Some ( items) = & attr. meta_item_list ( ) {
520
520
if let Some ( ident) = attr. ident ( ) {
521
- if is_lint_level ( ident. name ) {
521
+ if is_lint_level ( ident. name , attr . id ) {
522
522
check_clippy_lint_names ( cx, ident. name , items) ;
523
523
}
524
524
if matches ! ( ident. name, sym:: allow | sym:: expect) {
@@ -556,7 +556,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
556
556
return ;
557
557
}
558
558
if let Some ( lint_list) = & attr. meta_item_list ( ) {
559
- if attr. ident ( ) . map_or ( false , |ident| is_lint_level ( ident. name ) ) {
559
+ if attr. ident ( ) . map_or ( false , |ident| is_lint_level ( ident. name , attr . id ) ) {
560
560
for lint in lint_list {
561
561
match item. kind {
562
562
ItemKind :: Use ( ..) => {
@@ -1205,6 +1205,6 @@ fn check_mismatched_target_os(cx: &EarlyContext<'_>, attr: &Attribute) {
1205
1205
}
1206
1206
}
1207
1207
1208
- fn is_lint_level ( symbol : Symbol ) -> bool {
1209
- matches ! ( symbol, sym :: allow | sym :: expect | sym :: warn | sym :: deny | sym :: forbid )
1208
+ fn is_lint_level ( symbol : Symbol , attr_id : AttrId ) -> bool {
1209
+ Level :: from_symbol ( symbol, Some ( attr_id ) ) . is_some ( )
1210
1210
}
0 commit comments