aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/quote.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/quote.rs')
-rw-r--r--crates/ra_hir_expand/src/quote.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index 4de219ce4..57e7eebf9 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -15,14 +15,13 @@ macro_rules! __quote {
15 ( @SUBTREE $delim:ident $($tt:tt)* ) => { 15 ( @SUBTREE $delim:ident $($tt:tt)* ) => {
16 { 16 {
17 let children = $crate::__quote!($($tt)*); 17 let children = $crate::__quote!($($tt)*);
18 let subtree = tt::Subtree { 18 tt::Subtree {
19 delimiter: Some(tt::Delimiter { 19 delimiter: Some(tt::Delimiter {
20 kind: tt::DelimiterKind::$delim, 20 kind: tt::DelimiterKind::$delim,
21 id: tt::TokenId::unspecified(), 21 id: tt::TokenId::unspecified(),
22 }), 22 }),
23 token_trees: $crate::quote::IntoTt::to_tokens(children), 23 token_trees: $crate::quote::IntoTt::to_tokens(children),
24 }; 24 }
25 subtree
26 } 25 }
27 }; 26 };
28 27
@@ -259,8 +258,7 @@ mod tests {
259 // } 258 // }
260 let struct_name = mk_ident("Foo"); 259 let struct_name = mk_ident("Foo");
261 let fields = [mk_ident("name"), mk_ident("id")]; 260 let fields = [mk_ident("name"), mk_ident("id")];
262 let fields = 261 let fields = fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees).flatten();
263 fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten();
264 262
265 let list = tt::Subtree { 263 let list = tt::Subtree {
266 delimiter: Some(tt::Delimiter { 264 delimiter: Some(tt::Delimiter {