From e160882721c758a1e369a6212f8845abf2dd80d9 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 1 Jun 2022 12:24:39 +0200 Subject: [PATCH] Hide anonymous reexports in generated documentation --- src/librustdoc/visit_ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index d57868caf7a3a..00553d3f007ff 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -286,8 +286,8 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { self.visit_foreign_item(item, None, om); } } - // If we're inlining, skip private items. - _ if self.inlining && !is_pub => {} + // If we're inlining, skip private items or item reexported as "_". + _ if self.inlining && (!is_pub || renamed == Some(kw::Underscore)) => {} hir::ItemKind::GlobalAsm(..) => {} hir::ItemKind::Use(_, hir::UseKind::ListStem) => {} hir::ItemKind::Use(path, kind) => {