Skip to content

Commit a9d8459

Browse files
committed
Replace into_trees with trees in a test.
There's no need for token tree cloning here.
1 parent 53379a7 commit a9d8459

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_expand/src/parse/tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ fn bad_path_expr_1() {
6363
#[test]
6464
fn string_to_tts_macro() {
6565
create_default_session_globals_then(|| {
66-
let tts: Vec<_> =
67-
string_to_stream("macro_rules! zip (($a)=>($a))".to_string()).into_trees().collect();
68-
let tts: &[TokenTree] = &tts[..];
66+
let stream = string_to_stream("macro_rules! zip (($a)=>($a))".to_string());
67+
let tts = &stream.trees().collect::<Vec<_>>()[..];
6968

7069
match tts {
7170
[

0 commit comments

Comments
 (0)