about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-03-19 12:30:00 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2016-03-19 12:30:00 +0200
commit8be1d7d1a93d049e45a94edf956f3968d5a454d0 (patch)
tree6c9c3ded09117aaf17bf2b8705b86332f00a3fea
parent8a134404863055558697fe7f5d59661661ce172d (diff)
parent178b28099fa542430a8e9491e23053a162aedcb9 (diff)
downloadrust-8be1d7d1a93d049e45a94edf956f3968d5a454d0.tar.gz
rust-8be1d7d1a93d049e45a94edf956f3968d5a454d0.zip
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
-rw-r--r--src/libsyntax/ext/quote.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 38da478b5ed..77aeaf8459a 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -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,