]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_borrow.rs
Remove hir::Item::attrs.
[rust.git] / clippy_lints / src / needless_borrow.rs
index 1453ea6e8975da8856806e7f819f2748c8fc516c..1aadcfd87b60f73a1dc44626adc30300cae35d93 100644 (file)
@@ -115,8 +115,9 @@ fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) {
         }
     }
 
-    fn check_item(&mut self, _: &LateContext<'tcx>, item: &'tcx Item<'_>) {
-        if is_automatically_derived(item.attrs) {
+    fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
+        let attrs = cx.tcx.hir().attrs(item.hir_id());
+        if is_automatically_derived(attrs) {
             debug_assert!(self.derived_item.is_none());
             self.derived_item = Some(item.def_id);
         }