mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
Rollup merge of #23518 - farcaller:fix_quote_method, r=eddyb
This fixes several use cases that were broken after #23265 landed.
This commit is contained in:
@@ -176,6 +176,8 @@ 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::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 @@ 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::TraitItem> }
|
||||
impl_to_tokens! { P<ast::Pat> }
|
||||
impl_to_tokens! { ast::Arm }
|
||||
impl_to_tokens_lifetime! { &'a [P<ast::Item>] }
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user