]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/redundant_pub_crate.rs
ast/hir: Rename field-related structures
[rust.git] / clippy_lints / src / redundant_pub_crate.rs
index acd9047ace617459d3c7d5e54265d2b86573d14e..c876bae2303ad29f0252d0ec425d1b9ca17374c7 100644 (file)
@@ -42,11 +42,10 @@ pub struct RedundantPubCrate {
 impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
     fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
         if let VisibilityKind::Crate { .. } = item.vis.node {
-            if !cx.access_levels.is_exported(item.hir_id) {
+            if !cx.access_levels.is_exported(item.hir_id()) {
                 if let Some(false) = self.is_exported.last() {
                     let span = item.span.with_hi(item.ident.span.hi());
-                    let def_id = cx.tcx.hir().local_def_id(item.hir_id);
-                    let descr = cx.tcx.def_kind(def_id).descr(def_id.to_def_id());
+                    let descr = cx.tcx.def_kind(item.def_id).descr(item.def_id.to_def_id());
                     span_lint_and_then(
                         cx,
                         REDUNDANT_PUB_CRATE,
@@ -66,7 +65,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
         }
 
         if let ItemKind::Mod { .. } = item.kind {
-            self.is_exported.push(cx.access_levels.is_exported(item.hir_id));
+            self.is_exported.push(cx.access_levels.is_exported(item.hir_id()));
         }
     }