about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-19 14:21:17 +0100
committerGitHub <noreply@github.com>2019-01-19 14:21:17 +0100
commit349c9eeb355a979c2e51f832d05ce9212f0aeeba (patch)
tree26d22fe0672d754636b44b522130612192a09363 /src/libsyntax_ext
parentc87144f3caf9a1580e8734d4d1604e723a5bd6e6 (diff)
parent728572440171d8d9c0557c89c3d71cc8d7cf6c2e (diff)
downloadrust-349c9eeb355a979c2e51f832d05ce9212f0aeeba.tar.gz
rust-349c9eeb355a979c2e51f832d05ce9212f0aeeba.zip
Rollup merge of #57486 - nnethercote:simplify-TokenStream-more, r=petrochenkov
Simplify `TokenStream` some more

These commits simplify `TokenStream`, remove `ThinTokenStream`, and avoid some clones. The end result is simpler code and a slight perf win on some benchmarks.

r? @petrochenkov
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/proc_macro_server.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax_ext/proc_macro_server.rs b/src/libsyntax_ext/proc_macro_server.rs
index 158cbc791ef..7de9b9343a8 100644
--- a/src/libsyntax_ext/proc_macro_server.rs
+++ b/src/libsyntax_ext/proc_macro_server.rs
@@ -269,7 +269,7 @@ impl ToInternal<TokenStream> for TokenTree<Group, Punct, Ident, Literal> {
         };
 
         let tree = tokenstream::TokenTree::Token(span, token);
-        TokenStream::Tree(tree, if joint { Joint } else { NonJoint })
+        TokenStream::new(vec![(tree, if joint { Joint } else { NonJoint })])
     }
 }