Print visibility of `macro` items
This commit is contained in:
parent
8bf776d5c2
commit
b4ef99f4a6
|
@ -2387,7 +2387,7 @@ pub enum ItemKind {
|
|||
),
|
||||
/// A macro invocation.
|
||||
///
|
||||
/// E.g., `macro_rules! foo { .. }` or `foo!(..)`.
|
||||
/// E.g., `foo!(..)`.
|
||||
Mac(Mac),
|
||||
|
||||
/// A macro definition.
|
||||
|
|
|
@ -1369,8 +1369,12 @@ impl<'a> State<'a> {
|
|||
}
|
||||
}
|
||||
ast::ItemKind::MacroDef(ref macro_def) => {
|
||||
let (kw, has_bang) =
|
||||
if macro_def.legacy { ("macro_rules", true) } else { ("macro", false) };
|
||||
let (kw, has_bang) = if macro_def.legacy {
|
||||
("macro_rules", true)
|
||||
} else {
|
||||
self.print_visibility(&item.vis);
|
||||
("macro", false)
|
||||
};
|
||||
self.print_mac_common(
|
||||
Some(MacHeader::Keyword(kw)),
|
||||
has_bang,
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
#![feature(decl_macro)]
|
||||
|
||||
macro mac { ($ arg : expr) => { $ arg + $ arg } }
|
||||
pub(crate) macro mac { ($ arg : expr) => { $ arg + $ arg } }
|
||||
|
||||
fn main() { }
|
||||
|
|
Loading…
Reference in New Issue