about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-18 04:29:01 +0000
committerbors <bors@rust-lang.org>2019-09-18 04:29:01 +0000
commit64c09694a6ecc434cd3a61ade89beb1de17770c5 (patch)
tree472f37ba762da52367a989cd9f61668db4e239e8 /src/libsyntax
parent528379121ceb5fca5382b4337be7ac064890ec8c (diff)
parent76d34f343508e7009c8c3ee40819c8d5031b6d50 (diff)
Auto merge of #64570 - tmandry:rollup-3pg02lj, r=tmandry
Rollup of 4 pull requests

Successful merges:

 - #64486 (Print out more information for `-Zunpretty=expanded,hygiene`)
 - #64503 (rename Allocation::retag -> with_tags_and_extra)
 - #64516 (update Nomicon and Reference)
 - #64528 (Load proc macro metadata in the correct order.)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs2
-rw-r--r--src/libsyntax/print/pprust.rs10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index bcbc0a19ce7..b634dcca7fc 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -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.
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 5d8498f8b5d..bf36c0d2f56 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -35,6 +35,7 @@ pub enum AnnNode<'a> {
     SubItem(ast::NodeId),
     Expr(&'a ast::Expr),
     Pat(&'a ast::Pat),
+    Crate(&'a ast::Crate),
 }
 
 pub trait PpAnn {
@@ -140,6 +141,7 @@ pub fn print_crate<'a>(cm: &'a SourceMap,
 
     s.print_mod(&krate.module, &krate.attrs);
     s.print_remaining_comments();
+    s.ann.post(&mut s, AnnNode::Crate(krate));
     s.s.eof()
 }
 
@@ -1369,8 +1371,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,