@@ -208,7 +208,8 @@ impl LintPass for AttrPass {
208208impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for AttrPass {
209209 fn check_attribute ( & mut self , cx : & LateContext < ' a , ' tcx > , attr : & ' tcx Attribute ) {
210210 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 {
212213 "allow" | "warn" | "deny" | "forbid" => {
213214 check_clippy_lint_names ( cx, items) ;
214215 } ,
@@ -229,6 +230,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
229230 }
230231 }
231232 }
233+ }
232234
233235 fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item ) {
234236 if is_relevant_item ( cx. tcx , item) {
@@ -240,7 +242,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
240242
241243 for attr in & item. attrs {
242244 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 {
244247 "allow" | "warn" | "deny" | "forbid" => {
245248 // whitelist `unused_imports` and `deprecated` for `use` items
246249 // and `unused_imports` for `extern crate` items with `macro_use`
@@ -288,6 +291,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
288291 }
289292 }
290293 }
294+ }
291295 } ,
292296 _ => { } ,
293297 }
0 commit comments