@@ -10,7 +10,6 @@ use crate::tokenstream;
10
10
use syntax_pos:: Span ;
11
11
12
12
use rustc_data_structures:: sync:: Lrc ;
13
- use std:: iter:: Peekable ;
14
13
15
14
/// Takes a `tokenstream::TokenStream` and returns a `Vec<self::TokenTree>`. Specifically, this
16
15
/// takes a generic `TokenStream`, such as is used in the rest of the compiler, and returns a
@@ -43,7 +42,7 @@ pub(super) fn parse(
43
42
44
43
// For each token tree in `input`, parse the token into a `self::TokenTree`, consuming
45
44
// additional trees if need be.
46
- let mut trees = input. trees ( ) . peekable ( ) ;
45
+ let mut trees = input. trees ( ) ;
47
46
while let Some ( tree) = trees. next ( ) {
48
47
// Given the parsed tree, if there is a metavar and we are expecting matchers, actually
49
48
// parse out the matcher (i.e., in `$id:ident` this would parse the `:` and `ident`).
@@ -99,7 +98,7 @@ pub(super) fn parse(
99
98
/// unstable features or not.
100
99
fn parse_tree (
101
100
tree : tokenstream:: TokenTree ,
102
- trees : & mut Peekable < impl Iterator < Item = tokenstream:: TokenTree > > ,
101
+ trees : & mut impl Iterator < Item = tokenstream:: TokenTree > ,
103
102
expect_matchers : bool ,
104
103
sess : & ParseSess ,
105
104
) -> TokenTree {
@@ -222,7 +221,7 @@ fn parse_kleene_op(
222
221
/// operator and separator, then a tuple with `(separator, KleeneOp)` is returned. Otherwise, an
223
222
/// error with the appropriate span is emitted to `sess` and a dummy value is returned.
224
223
fn parse_sep_and_kleene_op (
225
- input : & mut Peekable < impl Iterator < Item = tokenstream:: TokenTree > > ,
224
+ input : & mut impl Iterator < Item = tokenstream:: TokenTree > ,
226
225
span : Span ,
227
226
sess : & ParseSess ,
228
227
) -> ( Option < Token > , KleeneToken ) {
0 commit comments