Skip to content

Commit 3802ba0

Browse files
Fix re-export of doc hidden macro not showing up
1 parent 223f6f5 commit 3802ba0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/librustdoc/clean/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,8 @@ fn clean_use_statement_inner<'tcx>(
25922592
} else {
25932593
if inline_attr.is_none()
25942594
&& let Res::Def(DefKind::Mod, did) = path.res
2595-
&& !did.is_local() && did.is_crate_root()
2595+
&& !did.is_local()
2596+
&& did.is_crate_root()
25962597
{
25972598
// if we're `pub use`ing an extern crate root, don't inline it unless we
25982599
// were specifically asked for it

src/librustdoc/visit_ast.rs

+10
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
310310
}
311311

312312
let ret = match tcx.hir().get_by_def_id(res_did) {
313+
// Bang macros are handled a bit on their because of how they are handled by the
314+
// compiler. If they have `#[doc(hidden)]` and the re-export doesn't have
315+
// `#[doc(inline)]`, then we don't inline it.
316+
Node::Item(&hir::Item { kind: hir::ItemKind::Macro(_, MacroKind::Bang), .. })
317+
if !please_inline
318+
&& renamed.is_some()
319+
&& self.cx.tcx.is_doc_hidden(ori_res_did) =>
320+
{
321+
return false;
322+
}
313323
Node::Item(&hir::Item { kind: hir::ItemKind::Mod(ref m), .. }) if glob => {
314324
let prev = mem::replace(&mut self.inlining, true);
315325
for &i in m.item_ids {

0 commit comments

Comments
 (0)