mirror of https://github.com/rust-lang/rust.git
Rollup merge of #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 #101105
This commit is contained in:
commit
5e388ea48e
|
@ -95,7 +95,14 @@ impl<'a, 'tcx> DocFolder for Stripper<'a, 'tcx> {
|
|||
}
|
||||
|
||||
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));
|
||||
|
|
|
@ -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