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:
Eduard-Mihai Burtescu 2016-03-19 12:30:00 +02:00
commit 8be1d7d1a9

View File

@ -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 {
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
vec![TokenTree::Token(self.span,