From 5b1622b3243633a41259780bd9afda11c08c40a5 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Sun, 26 Apr 2020 10:12:14 +0200 Subject: [PATCH] rustup to https://github.com/rust-lang/rust/pull/70043 --- clippy_lints/src/redundant_pub_crate.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/redundant_pub_crate.rs b/clippy_lints/src/redundant_pub_crate.rs index 4479c560465..6fc07f91660 100644 --- a/clippy_lints/src/redundant_pub_crate.rs +++ b/clippy_lints/src/redundant_pub_crate.rs @@ -45,11 +45,13 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'tcx>) { 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()); span_lint_and_then( cx, REDUNDANT_PUB_CRATE, span, - &format!("pub(crate) {} inside private module", item.kind.descr()), + &format!("pub(crate) {} inside private module", descr), |diag| { diag.span_suggestion( item.vis.span,