about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-26 11:26:15 +0000
committerbors <bors@rust-lang.org>2020-04-26 11:26:15 +0000
commitb7c802b5e33f5a402de3780bc5a8b05e7ebad409 (patch)
treeeb4a026f31b4b79eb2daaa27ab021f60a73c6f00
parent07dd5fada91b3a3219febb91c4dd0932c384f9c7 (diff)
parent5b1622b3243633a41259780bd9afda11c08c40a5 (diff)
downloadrust-b7c802b5e33f5a402de3780bc5a8b05e7ebad409.tar.gz
rust-b7c802b5e33f5a402de3780bc5a8b05e7ebad409.zip
Auto merge of #5533 - phansch:rustup001, r=matthiaskrgr
rustup to https://github.com/rust-lang/rust/pull/70043

changelog: none
-rw-r--r--clippy_lints/src/redundant_pub_crate.rs4
1 files changed, 3 insertions, 1 deletions
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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantPubCrate {
             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,