rustdoc: fixed #101105

modules are now stripped based on the same logic that's used to strip other item kinds
This commit is contained in:
schvv31n 2024-08-08 17:13:15 +01:00
parent 8b3870784f
commit c2a0d9ca6e
2 changed files with 14 additions and 1 deletions

View File

@ -95,7 +95,14 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
} }
clean::ModuleItem(..) => { clean::ModuleItem(..) => {
if i.item_id.is_local() && i.visibility(self.tcx) != Some(Visibility::Public) { if i.item_id.is_local()
&& !is_item_reachable(
self.tcx,
self.is_json_output,
self.effective_visibilities,
i.item_id,
)
{
debug!("Stripper: stripping module {:?}", i.name); debug!("Stripper: stripping module {:?}", i.name);
let old = mem::replace(&mut self.update_retained, false); let old = mem::replace(&mut self.update_retained, false);
let ret = strip_item(self.fold_item_recur(i)); let ret = strip_item(self.fold_item_recur(i));

View File

@ -0,0 +1,6 @@
// See https://github.com/rust-lang/rust/issues/101105
//@ !has "$.index[*][?(@.name=='nucleus')]"
mod corpus {
pub mod nucleus {}
}