about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/parse/tests.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-27 10:40:39 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-07-27 10:40:39 +1000
commita9d84592995c18b33f69e85735210c50438596e1 (patch)
tree28c43fae7d7ed42ac4bb0d637c3c939b09a9eb36 /compiler/rustc_expand/src/parse/tests.rs
parent53379a7b65055fc272db1178f68c9cef9b4aa3bc (diff)
downloadrust-a9d84592995c18b33f69e85735210c50438596e1.tar.gz
rust-a9d84592995c18b33f69e85735210c50438596e1.zip
Replace `into_trees` with `trees` in a test.
There's no need for token tree cloning here.
Diffstat (limited to 'compiler/rustc_expand/src/parse/tests.rs')
-rw-r--r--compiler/rustc_expand/src/parse/tests.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/parse/tests.rs b/compiler/rustc_expand/src/parse/tests.rs
index f891850963e..541f2686235 100644
--- a/compiler/rustc_expand/src/parse/tests.rs
+++ b/compiler/rustc_expand/src/parse/tests.rs
@@ -63,9 +63,8 @@ fn bad_path_expr_1() {
 #[test]
 fn string_to_tts_macro() {
     create_default_session_globals_then(|| {
-        let tts: Vec<_> =
-            string_to_stream("macro_rules! zip (($a)=>($a))".to_string()).into_trees().collect();
-        let tts: &[TokenTree] = &tts[..];
+        let stream = string_to_stream("macro_rules! zip (($a)=>($a))".to_string());
+        let tts = &stream.trees().collect::<Vec<_>>()[..];
 
         match tts {
             [