Don't hide anonymous re-exports but never inline them

This commit is contained in:
Guillaume Gomez 2023-03-09 13:32:07 +01:00
parent 7c306f6dcd
commit e8bd4ef1e5

View file

@ -223,6 +223,11 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
) -> bool {
debug!("maybe_inline_local res: {:?}", res);
if renamed == Some(kw::Underscore) {
// We never inline `_` reexports.
return false;
}
if self.cx.output_format.is_json() {
return false;
}
@ -329,8 +334,8 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
self.visit_foreign_item_inner(item, None);
}
}
// If we're inlining, skip private items or item reexported as "_".
_ if self.inlining && (!is_pub || renamed == Some(kw::Underscore)) => {}
// If we're inlining, skip private items.
_ if self.inlining && !is_pub => {}
hir::ItemKind::GlobalAsm(..) => {}
hir::ItemKind::Use(_, hir::UseKind::ListStem) => {}
hir::ItemKind::Use(path, kind) => {