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:
parent
8b3870784f
commit
c2a0d9ca6e
@ -95,7 +95,14 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
|
||||
}
|
||||
|
||||
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);
|
||||
let old = mem::replace(&mut self.update_retained, false);
|
||||
let ret = strip_item(self.fold_item_recur(i));
|
||||
|
6
tests/rustdoc-json/pub_mod_in_private_mod.rs
Normal file
6
tests/rustdoc-json/pub_mod_in_private_mod.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// See https://github.com/rust-lang/rust/issues/101105
|
||||
|
||||
//@ !has "$.index[*][?(@.name=='nucleus')]"
|
||||
mod corpus {
|
||||
pub mod nucleus {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user