Auto merge of #5533 - phansch:rustup001, r=matthiaskrgr
rustup to https://github.com/rust-lang/rust/pull/70043 changelog: none
This commit is contained in:
commit
b7c802b5e3
1 changed files with 3 additions and 1 deletions
|
|
@ -45,11 +45,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantPubCrate {
|
||||||
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() {
|
if let Some(false) = self.is_exported.last() {
|
||||||
let span = item.span.with_hi(item.ident.span.hi());
|
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(
|
span_lint_and_then(
|
||||||
cx,
|
cx,
|
||||||
REDUNDANT_PUB_CRATE,
|
REDUNDANT_PUB_CRATE,
|
||||||
span,
|
span,
|
||||||
&format!("pub(crate) {} inside private module", item.kind.descr()),
|
&format!("pub(crate) {} inside private module", descr),
|
||||||
|diag| {
|
|diag| {
|
||||||
diag.span_suggestion(
|
diag.span_suggestion(
|
||||||
item.vis.span,
|
item.vis.span,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue