Skip to content

Commit

Permalink
Rollup merge of rust-lang#32269 - richo:impl-totokens-p-implitem, r=n…
Browse files Browse the repository at this point in the history
…ikomatsakis

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
  • Loading branch information
eddyb committed Mar 19, 2016
2 parents 8a13440 + 178b280 commit 8be1d7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8be1d7d

Please sign in to comment.