Skip to content

Commit 8be1d7d

Browse files
committed
Rollup merge of rust-lang#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
2 parents 8a13440 + 178b280 commit 8be1d7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libsyntax/ext/quote.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ pub mod rt {
121121
}
122122
}
123123

124+
impl ToTokens for P<ast::ImplItem> {
125+
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
126+
vec![TokenTree::Token(self.span, token::Interpolated(token::NtImplItem(self.clone())))]
127+
}
128+
}
129+
124130
impl ToTokens for ast::TraitItem {
125131
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
126132
vec![TokenTree::Token(self.span,

0 commit comments

Comments
 (0)