ast::ItemKind::Impl(..) => return,
// Only exported `macro_rules!` items are public, but they always are
- ast::ItemKind::MacroDef(..) => {
+ ast::ItemKind::MacroDef(ref macro_def) if macro_def.macro_rules => {
let is_macro_export =
item.attrs.iter().any(|attr| attr.has_name(sym::macro_export));
if is_macro_export { Some(AccessLevel::Public) } else { None }
| ast::ItemKind::Struct(..)
| ast::ItemKind::Union(..)
| ast::ItemKind::Trait(..)
- | ast::ItemKind::TraitAlias(..) => {
+ | ast::ItemKind::TraitAlias(..)
+ | ast::ItemKind::MacroDef(..) => {
if item.vis.kind.is_pub() {
self.prev_level
} else {