From e3cde9783b33ed4decd467602ff3d47505eadab5 Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Thu, 19 Mar 2015 17:01:15 +0000 Subject: [PATCH] Added missing impl_to_source! and impl_to_tokens! for ImplItem. This fixes several use cases that were broken after #23265 landed. --- src/libsyntax/ext/quote.rs | 2 ++ src/libsyntax/print/pprust.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index c38556b078219..de00ea4deaea5 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -176,6 +176,7 @@ pub mod rt { impl_to_source! { ast::Arg, arg_to_string } impl_to_source! { Generics, generics_to_string } impl_to_source! { P, item_to_string } + impl_to_source! { P, impl_item_to_string } impl_to_source! { P, stmt_to_string } impl_to_source! { P, expr_to_string } impl_to_source! { P, pat_to_string } @@ -308,6 +309,7 @@ pub mod rt { impl_to_tokens! { ast::Ident } impl_to_tokens! { P } + impl_to_tokens! { P } impl_to_tokens! { P } impl_to_tokens! { ast::Arm } impl_to_tokens_lifetime! { &'a [P] } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index b58c121c5fd54..51478ccf859a6 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -355,6 +355,10 @@ 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 generics_to_string(generics: &ast::Generics) -> String { $to_string(|s| s.print_generics(generics)) }