about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index ae045fc095a..fbcd251f108 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -281,6 +281,7 @@ pub fn token_to_string(tok: &Token) -> String {
             token::NtArg(ref e)          => arg_to_string(e),
             token::NtVis(ref e)          => vis_to_string(e),
             token::NtLifetime(ref e)     => lifetime_to_string(e),
+            token::NtForeignItem(ref ni) => foreign_item_to_string(ni),
         }
     }
 }
@@ -422,6 +423,10 @@ pub fn mac_to_string(arg: &ast::Mac) -> String {
     to_string(|s| s.print_mac(arg, ::parse::token::Paren))
 }
 
+pub fn foreign_item_to_string(arg: &ast::ForeignItem) -> String {
+    to_string(|s| s.print_foreign_item(arg))
+}
+
 pub fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
     format!("{}{}", to_string(|s| s.print_visibility(vis)), s)
 }
@@ -1127,6 +1132,10 @@ impl<'a> State<'a> {
                 self.end()?; // end the head-ibox
                 self.end() // end the outer cbox
             }
+            ast::ForeignItemKind::Macro(ref m) => {
+                self.print_mac(m, token::Paren)?;
+                self.s.word(";")
+            }
         }
     }