From a9d84592995c18b33f69e85735210c50438596e1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 27 Jul 2023 10:40:39 +1000 Subject: [PATCH] Replace `into_trees` with `trees` in a test. There's no need for token tree cloning here. --- compiler/rustc_expand/src/parse/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_expand/src/parse/tests.rs b/compiler/rustc_expand/src/parse/tests.rs index f891850963ea..541f26862358 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::>()[..]; match tts { [