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;