diff options
Diffstat (limited to 'crates/ra_hir_expand/src/quote.rs')
-rw-r--r-- | crates/ra_hir_expand/src/quote.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs index bce38cc67..49155fe62 100644 --- a/crates/ra_hir_expand/src/quote.rs +++ b/crates/ra_hir_expand/src/quote.rs | |||
@@ -16,7 +16,10 @@ macro_rules! __quote { | |||
16 | { | 16 | { |
17 | let children = $crate::__quote!($($tt)*); | 17 | let children = $crate::__quote!($($tt)*); |
18 | let subtree = tt::Subtree { | 18 | let subtree = tt::Subtree { |
19 | delimiter: Some(tt::Delimiter::$delim), | 19 | delimiter: Some(tt::Delimiter { |
20 | kind: tt::DelimiterKind::$delim, | ||
21 | id: tt::TokenId::unspecified(), | ||
22 | }), | ||
20 | token_trees: $crate::quote::IntoTt::to_tokens(children), | 23 | token_trees: $crate::quote::IntoTt::to_tokens(children), |
21 | }; | 24 | }; |
22 | subtree | 25 | subtree |
@@ -257,8 +260,13 @@ mod tests { | |||
257 | let fields = | 260 | let fields = |
258 | fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); | 261 | fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); |
259 | 262 | ||
260 | let list = | 263 | let list = tt::Subtree { |
261 | tt::Subtree { delimiter: Some(tt::Delimiter::Brace), token_trees: fields.collect() }; | 264 | delimiter: Some(tt::Delimiter { |
265 | kind: tt::DelimiterKind::Brace, | ||
266 | id: tt::TokenId::unspecified(), | ||
267 | }), | ||
268 | token_trees: fields.collect(), | ||
269 | }; | ||
262 | 270 | ||
263 | let quoted = quote! { | 271 | let quoted = quote! { |
264 | impl Clone for #struct_name { | 272 | impl Clone for #struct_name { |