@@ -10,7 +10,6 @@ use crate::tokenstream;
1010use syntax_pos:: Span ;
1111
1212use rustc_data_structures:: sync:: Lrc ;
13- use std:: iter:: Peekable ;
1413
1514/// Takes a `tokenstream::TokenStream` and returns a `Vec<self::TokenTree>`. Specifically, this
1615/// 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(
4342
4443 // For each token tree in `input`, parse the token into a `self::TokenTree`, consuming
4544 // additional trees if need be.
46- let mut trees = input. trees ( ) . peekable ( ) ;
45+ let mut trees = input. trees ( ) ;
4746 while let Some ( tree) = trees. next ( ) {
4847 // Given the parsed tree, if there is a metavar and we are expecting matchers, actually
4948 // parse out the matcher (i.e., in `$id:ident` this would parse the `:` and `ident`).
@@ -99,7 +98,7 @@ pub(super) fn parse(
9998/// unstable features or not.
10099fn parse_tree (
101100 tree : tokenstream:: TokenTree ,
102- trees : & mut Peekable < impl Iterator < Item = tokenstream:: TokenTree > > ,
101+ trees : & mut impl Iterator < Item = tokenstream:: TokenTree > ,
103102 expect_matchers : bool ,
104103 sess : & ParseSess ,
105104) -> TokenTree {
@@ -222,7 +221,7 @@ fn parse_kleene_op(
222221/// operator and separator, then a tuple with `(separator, KleeneOp)` is returned. Otherwise, an
223222/// error with the appropriate span is emitted to `sess` and a dummy value is returned.
224223fn parse_sep_and_kleene_op (
225- input : & mut Peekable < impl Iterator < Item = tokenstream:: TokenTree > > ,
224+ input : & mut impl Iterator < Item = tokenstream:: TokenTree > ,
226225 span : Span ,
227226 sess : & ParseSess ,
228227) -> ( Option < Token > , KleeneToken ) {
0 commit comments