Added missing impl_to_source! and impl_to_tokens! for ImplItem.

This fixes several use cases that were broken after #23265 landed.
This commit is contained in:
Vladimir Pouzanov 2015-03-19 17:01:15 +00:00
parent 08dd30d9eb
commit e3cde9783b
2 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,7 @@ fn to_source_with_hygiene(&self) -> String {
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::Stmt>, stmt_to_string }
impl_to_source! { P<ast::Expr>, expr_to_string }
impl_to_source! { P<ast::Pat>, pat_to_string }
@ -308,6 +309,7 @@ fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {
impl_to_tokens! { ast::Ident }
impl_to_tokens! { P<ast::Item> }
impl_to_tokens! { P<ast::ImplItem> }
impl_to_tokens! { P<ast::Pat> }
impl_to_tokens! { ast::Arm }
impl_to_tokens_lifetime! { &'a [P<ast::Item>] }

View File

@ -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))
}