Skip to content

Commit 090dbb1

Browse files
Don't strip items with inherited visibility in AliasedNonLocalStripper
1 parent dbfed2c commit 090dbb1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustdoc/passes/strip_aliased_non_local.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@ impl<'tcx> DocFolder for NonLocalStripper<'tcx> {
4646
// the field and not the one given by the user for the currrent crate.
4747
//
4848
// FIXME(#125009): Not-local should probably consider same Cargo workspace
49-
if !i.def_id().map_or(true, |did| did.is_local()) {
50-
if i.visibility(self.tcx) != Some(Visibility::Public) || i.is_doc_hidden() {
49+
if let Some(def_id) = i.def_id()
50+
&& !def_id.is_local()
51+
{
52+
if i.is_doc_hidden()
53+
// Default to *not* stripping items with inherited visibility.
54+
|| i.visibility(self.tcx).map_or(false, |viz| viz != Visibility::Public)
55+
{
5156
return Some(strip_item(i));
5257
}
5358
}

0 commit comments

Comments
 (0)