about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-20 05:31:12 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-20 12:43:13 +0530
commit2ac03bceb41fb84ff689d07603471e0ce17da44f (patch)
tree7fc71b1cfba3db1126cbbb018ba70464d7d4ef10 /src/libsyntax
parentc785e7e2a1fd86f5600a49c27ba6ac01a22ca7de (diff)
parentbd1f562e19574fa3be5bec2aa661816ac830bb69 (diff)
downloadrust-2ac03bceb41fb84ff689d07603471e0ce17da44f.tar.gz
rust-2ac03bceb41fb84ff689d07603471e0ce17da44f.zip
Rollup merge of #23518 - farcaller:fix_quote_method, r=eddyb
 This fixes several use cases that were broken after #23265 landed.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/quote.rs4
-rw-r--r--src/libsyntax/print/pprust.rs8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index c38556b0782..c11ffe66e6c 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -176,6 +176,8 @@ pub mod rt {
     impl_to_source! { ast::Arg, arg_to_string }
     impl_to_source! { Generics, generics_to_string }
     impl_to_source! { P<ast::Item>, item_to_string }
+    impl_to_source! { P<ast::ImplItem>, impl_item_to_string }
+    impl_to_source! { P<ast::TraitItem>, trait_item_to_string }
     impl_to_source! { P<ast::Stmt>, stmt_to_string }
     impl_to_source! { P<ast::Expr>, expr_to_string }
     impl_to_source! { P<ast::Pat>, pat_to_string }
@@ -308,6 +310,8 @@ pub mod rt {
 
     impl_to_tokens! { ast::Ident }
     impl_to_tokens! { P<ast::Item> }
+    impl_to_tokens! { P<ast::ImplItem> }
+    impl_to_tokens! { P<ast::TraitItem> }
     impl_to_tokens! { P<ast::Pat> }
     impl_to_tokens! { ast::Arm }
     impl_to_tokens_lifetime! { &'a [P<ast::Item>] }
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index b58c121c5fd..239fea57d94 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -355,6 +355,14 @@ pub fn item_to_string(i: &ast::Item) -> String {
     $to_string(|s| s.print_item(i))
 }
 
+pub fn impl_item_to_string(i: &ast::ImplItem) -> String {
+    $to_string(|s| s.print_impl_item(i))
+}
+
+pub fn trait_item_to_string(i: &ast::TraitItem) -> String {
+    $to_string(|s| s.print_trait_item(i))
+}
+
 pub fn generics_to_string(generics: &ast::Generics) -> String {
     $to_string(|s| s.print_generics(generics))
 }