]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/pass_by_ref_or_value.rs
Auto merge of #71780 - jcotton42:string_remove_matches, r=joshtriplett
[rust.git] / src / tools / clippy / clippy_lints / src / pass_by_ref_or_value.rs
index b9ba32001b5137620f077b3996ef7bc00dab041c..ff700aa51460789cc66d0aa7779ce65a24ec0cb2 100644 (file)
@@ -224,10 +224,11 @@ fn check_fn(
         }
 
         match kind {
-            FnKind::ItemFn(.., header, _, attrs) => {
+            FnKind::ItemFn(.., header, _) => {
                 if header.abi != Abi::Rust {
                     return;
                 }
+                let attrs = cx.tcx.hir().attrs(hir_id);
                 for a in attrs {
                     if let Some(meta_items) = a.meta_item_list() {
                         if a.has_name(sym::proc_macro_derive)
@@ -239,7 +240,7 @@ fn check_fn(
                 }
             },
             FnKind::Method(..) => (),
-            FnKind::Closure(..) => return,
+            FnKind::Closure => return,
         }
 
         // Exclude non-inherent impls