From dd15f410df09233389d7ac084b2634044d50e58b Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Sun, 27 Dec 2020 21:15:01 +0100 Subject: [PATCH] WIP: attempt to fix the undocument re-export issue --- compiler/rustc_privacy/src/lib.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 1bcfdf0faf6..6332130f80e 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -832,8 +832,19 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> { } fn visit_macro_def(&mut self, md: &'tcx hir::MacroDef<'tcx>) { - if attr::find_transparency(&self.tcx.sess, &md.attrs, md.ast.macro_rules).0 - != Transparency::Opaque + // HACK (or fix?): a + // ```rust,ignore (dummy example) + // mod private { + // #[rustc_macro_transparency(semitransparent)] + // pub macro m { … } + // } + // ``` + // is *not* `Public`ly reachable and yet this shortcut would express + // that. + // FIXME! + if md.ast.macro_rules + && attr::find_transparency(&self.tcx.sess, &md.attrs, md.ast.macro_rules).0 + != Transparency::Opaque { self.update(md.hir_id, Some(AccessLevel::Public)); return;