WIP: attempt to fix the undocument re-export issue

This commit is contained in:
Daniel Henry-Mantilla 2020-12-27 21:15:01 +01:00
parent 28e9c6723a
commit dd15f410df
1 changed files with 13 additions and 2 deletions

View File

@ -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;