@@ -208,7 +208,8 @@ impl LintPass for AttrPass {
208
208
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for AttrPass {
209
209
fn check_attribute ( & mut self , cx : & LateContext < ' a , ' tcx > , attr : & ' tcx Attribute ) {
210
210
if let Some ( items) = & attr. meta_item_list ( ) {
211
- match & * attr. name ( ) . as_str ( ) {
211
+ if let Some ( ident) = attr. ident_str ( ) {
212
+ match ident {
212
213
"allow" | "warn" | "deny" | "forbid" => {
213
214
check_clippy_lint_names ( cx, items) ;
214
215
} ,
@@ -229,6 +230,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
229
230
}
230
231
}
231
232
}
233
+ }
232
234
233
235
fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item ) {
234
236
if is_relevant_item ( cx. tcx , item) {
@@ -240,7 +242,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
240
242
241
243
for attr in & item. attrs {
242
244
if let Some ( lint_list) = & attr. meta_item_list ( ) {
243
- match & * attr. name ( ) . as_str ( ) {
245
+ if let Some ( ident) = attr. ident_str ( ) {
246
+ match ident {
244
247
"allow" | "warn" | "deny" | "forbid" => {
245
248
// whitelist `unused_imports` and `deprecated` for `use` items
246
249
// and `unused_imports` for `extern crate` items with `macro_use`
@@ -288,6 +291,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
288
291
}
289
292
}
290
293
}
294
+ }
291
295
} ,
292
296
_ => { } ,
293
297
}
0 commit comments