File tree 1 file changed +4
-4
lines changed
src/librustc_parse/parser
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -399,10 +399,7 @@ impl<'a> Parser<'a> {
399
399
400
400
/// Parses a single argument in the angle arguments `<...>` of a path segment.
401
401
fn parse_angle_arg ( & mut self ) -> PResult < ' a , Option < AngleBracketedArg > > {
402
- let arg = if self . check_lifetime ( ) && self . look_ahead ( 1 , |t| !t. is_like_plus ( ) ) {
403
- // Parse lifetime argument.
404
- AngleBracketedArg :: Arg ( GenericArg :: Lifetime ( self . expect_lifetime ( ) ) )
405
- } else if self . check_ident ( )
402
+ let arg = if self . check_ident ( )
406
403
&& self . look_ahead ( 1 , |t| matches ! ( t. kind, token:: Eq | token:: Colon ) )
407
404
{
408
405
// Parse associated type constraint.
@@ -426,6 +423,9 @@ impl<'a> Parser<'a> {
426
423
427
424
let constraint = AssocTyConstraint { id : ast:: DUMMY_NODE_ID , ident, kind, span } ;
428
425
AngleBracketedArg :: Constraint ( constraint)
426
+ } else if self . check_lifetime ( ) && self . look_ahead ( 1 , |t| !t. is_like_plus ( ) ) {
427
+ // Parse lifetime argument.
428
+ AngleBracketedArg :: Arg ( GenericArg :: Lifetime ( self . expect_lifetime ( ) ) )
429
429
} else if self . check_const_arg ( ) {
430
430
// Parse const argument.
431
431
let expr = if let token:: OpenDelim ( token:: Brace ) = self . token . kind {
You can’t perform that action at this time.
0 commit comments