diff options
| author | Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com> | 2020-12-27 21:15:01 +0100 |
|---|---|---|
| committer | Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com> | 2021-01-06 15:13:39 +0100 |
| commit | dd15f410df09233389d7ac084b2634044d50e58b (patch) | |
| tree | 6db3636cf81f2d1c2f6273e98e4e295d08f3ae4f | |
| parent | 28e9c6723a9111b649384ca909eded20c18c76a3 (diff) | |
| download | rust-dd15f410df09233389d7ac084b2634044d50e58b.tar.gz rust-dd15f410df09233389d7ac084b2634044d50e58b.zip | |
WIP: attempt to fix the undocument re-export issue
| -rw-r--r-- | compiler/rustc_privacy/src/lib.rs | 15 |
1 files 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; |
