aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r--crates/ra_hir_expand/src/quote.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index 4f698ff13..aa8a5f23f 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -16,7 +16,7 @@ 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: tt::Delimiter::$delim, 19 delimiter: Some(tt::Delimiter::$delim),
20 token_trees: $crate::quote::IntoTt::to_tokens(children), 20 token_trees: $crate::quote::IntoTt::to_tokens(children),
21 }; 21 };
22 subtree 22 subtree
@@ -124,7 +124,7 @@ pub(crate) trait IntoTt {
124 124
125impl IntoTt for Vec<tt::TokenTree> { 125impl IntoTt for Vec<tt::TokenTree> {
126 fn to_subtree(self) -> tt::Subtree { 126 fn to_subtree(self) -> tt::Subtree {
127 tt::Subtree { delimiter: tt::Delimiter::None, token_trees: self } 127 tt::Subtree { delimiter: None, token_trees: self }
128 } 128 }
129 129
130 fn to_tokens(self) -> Vec<tt::TokenTree> { 130 fn to_tokens(self) -> Vec<tt::TokenTree> {
@@ -254,7 +254,8 @@ mod tests {
254 let fields = 254 let fields =
255 fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); 255 fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten();
256 256
257 let list = tt::Subtree { delimiter: tt::Delimiter::Brace, token_trees: fields.collect() }; 257 let list =
258 tt::Subtree { delimiter: Some(tt::Delimiter::Brace), token_trees: fields.collect() };
258 259
259 let quoted = quote! { 260 let quoted = quote! {
260 impl Clone for #struct_name { 261 impl Clone for #struct_name {