@@ -249,19 +249,16 @@ pub fn parse(
249
249
/// - `sess`: the parsing session. Any errors will be emitted to this session.
250
250
/// - `features`, `attrs`: language feature flags and attributes so that we know whether to use
251
251
/// unstable features or not.
252
- fn parse_tree < I > (
252
+ fn parse_tree (
253
253
tree : tokenstream:: TokenTree ,
254
- trees : & mut Peekable < I > ,
254
+ trees : & mut Peekable < impl Iterator < Item = tokenstream :: TokenTree > > ,
255
255
expect_matchers : bool ,
256
256
sess : & ParseSess ,
257
257
features : & Features ,
258
258
attrs : & [ ast:: Attribute ] ,
259
259
edition : Edition ,
260
260
macro_node_id : NodeId ,
261
- ) -> TokenTree
262
- where
263
- I : Iterator < Item = tokenstream:: TokenTree > ,
264
- {
261
+ ) -> TokenTree {
265
262
// Depending on what `tree` is, we could be parsing different parts of a macro
266
263
match tree {
267
264
// `tree` is a `$` token. Look at the next token in `trees`
@@ -365,10 +362,10 @@ fn kleene_op(token: &Token) -> Option<KleeneOp> {
365
362
/// - Ok(Ok((op, span))) if the next token tree is a KleeneOp
366
363
/// - Ok(Err(tok, span)) if the next token tree is a token but not a KleeneOp
367
364
/// - Err(span) if the next token tree is not a token
368
- fn parse_kleene_op < I > ( input : & mut I , span : Span ) -> Result < Result < ( KleeneOp , Span ) , Token > , Span >
369
- where
370
- I : Iterator < Item = tokenstream :: TokenTree > ,
371
- {
365
+ fn parse_kleene_op (
366
+ input : & mut impl Iterator < Item = tokenstream :: TokenTree > ,
367
+ span : Span ,
368
+ ) -> Result < Result < ( KleeneOp , Span ) , Token > , Span > {
372
369
match input. next ( ) {
373
370
Some ( tokenstream:: TokenTree :: Token ( token) ) => match kleene_op ( & token) {
374
371
Some ( op) => Ok ( Ok ( ( op, token. span ) ) ) ,
@@ -378,7 +375,7 @@ where
378
375
. as_ref ( )
379
376
. map ( tokenstream:: TokenTree :: span)
380
377
. unwrap_or ( span) ) ,
381
- }
378
+ }
382
379
}
383
380
384
381
/// Attempt to parse a single Kleene star, possibly with a separator.
0 commit comments