aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro_srv/src/rustc_server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_proc_macro_srv/src/rustc_server.rs')
-rw-r--r--crates/ra_proc_macro_srv/src/rustc_server.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_proc_macro_srv/src/rustc_server.rs b/crates/ra_proc_macro_srv/src/rustc_server.rs
index ec0d35692..9fcfdc450 100644
--- a/crates/ra_proc_macro_srv/src/rustc_server.rs
+++ b/crates/ra_proc_macro_srv/src/rustc_server.rs
@@ -76,7 +76,16 @@ impl Extend<TokenTree> for TokenStream {
76impl Extend<TokenStream> for TokenStream { 76impl Extend<TokenStream> for TokenStream {
77 fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) { 77 fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
78 for item in streams { 78 for item in streams {
79 self.subtree.token_trees.extend(&mut item.into_iter()) 79 for tkn in item {
80 match tkn {
81 tt::TokenTree::Subtree(subtree) if subtree.delimiter.is_none() => {
82 self.subtree.token_trees.extend(subtree.token_trees);
83 }
84 _ => {
85 self.subtree.token_trees.push(tkn);
86 }
87 }
88 }
80 } 89 }
81 } 90 }
82} 91}