Rollup merge of #32269 - richo:impl-totokens-p-implitem, r=nikomatsakis
syntax: impl ToTokens for P<ast::ImplItem> I'm working on updating zinc for latest rust, and it appears that I need this impl[0]. More generally, I realise that libsyntax is "Whatever the compiler team needs to build a compiler", but should I just open a PR fleshing this out for all types? https://github.com/hackndev/zinc/blob/master/ioreg/src/builder/setter.rs#L194-L197
This commit is contained in:
commit
8be1d7d1a9
1 changed files with 6 additions and 0 deletions
|
@ -121,6 +121,12 @@ pub mod rt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToTokens for P<ast::ImplItem> {
|
||||||
|
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
|
||||||
|
vec![TokenTree::Token(self.span, token::Interpolated(token::NtImplItem(self.clone())))]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ToTokens for ast::TraitItem {
|
impl ToTokens for ast::TraitItem {
|
||||||
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
|
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
|
||||||
vec![TokenTree::Token(self.span,
|
vec![TokenTree::Token(self.span,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue