Skip to content

Commit dcb277a

Browse files
authored
Unrolled build for rust-lang#128834
Rollup merge of rust-lang#128834 - its-the-shrimp:fix_101105, r=aDotInTheVoid rustdoc: strip unreachable modules Modules are now stripped based on the same logic that's used to strip other item kinds Fixes rust-lang#101105
2 parents c7b0d4e + c2a0d9c commit dcb277a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/librustdoc/passes/stripper.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ impl<'a, 'tcx> DocFolder for Stripper<'a, 'tcx> {
9595
}
9696

9797
clean::ModuleItem(..) => {
98-
if i.item_id.is_local() && i.visibility(self.tcx) != Some(Visibility::Public) {
98+
if i.item_id.is_local()
99+
&& !is_item_reachable(
100+
self.tcx,
101+
self.is_json_output,
102+
self.effective_visibilities,
103+
i.item_id,
104+
)
105+
{
99106
debug!("Stripper: stripping module {:?}", i.name);
100107
let old = mem::replace(&mut self.update_retained, false);
101108
let ret = strip_item(self.fold_item_recur(i));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// See https://github.com/rust-lang/rust/issues/101105
2+
3+
//@ !has "$.index[*][?(@.name=='nucleus')]"
4+
mod corpus {
5+
pub mod nucleus {}
6+
}

0 commit comments

Comments
 (0)