@@ -583,6 +583,11 @@ impl<'a> Parser<'a> {
583583 }
584584 }
585585
586+ fn parse_ident_into_path ( & mut self ) -> PResult < ' a , ast:: Path > {
587+ let ident = self . parse_ident ( ) ?;
588+ Ok ( ast:: Path :: from_ident ( self . last_span , ident) )
589+ }
590+
586591 /// Check if the next token is `tok`, and return `true` if so.
587592 ///
588593 /// This method will automatically add `tok` to `expected_tokens` if `tok` is not
@@ -1462,7 +1467,7 @@ impl<'a> Parser<'a> {
14621467 } else if self . eat_lt ( ) {
14631468
14641469 let ( qself, path) =
1465- self . parse_qualified_path ( NoTypesAllowed ) ?;
1470+ self . parse_qualified_path ( LifetimeAndTypesWithoutColons ) ?;
14661471
14671472 TyKind :: Path ( Some ( qself) , path)
14681473 } else if self . is_path_start ( ) {
@@ -3573,7 +3578,7 @@ impl<'a> Parser<'a> {
35733578 let ( qself, path) = if self . eat_lt ( ) {
35743579 // Parse a qualified path
35753580 let ( qself, path) =
3576- self . parse_qualified_path ( NoTypesAllowed ) ?;
3581+ self . parse_qualified_path ( LifetimeAndTypesWithColons ) ?;
35773582 ( Some ( qself) , path)
35783583 } else {
35793584 // Parse an unqualified path
@@ -3651,9 +3656,7 @@ impl<'a> Parser<'a> {
36513656 // Plain idents have some extra abilities here compared to general paths
36523657 if self . look_ahead ( 1 , |t| * t == token:: Not ) {
36533658 // Parse macro invocation
3654- let ident = self . parse_ident ( ) ?;
3655- let ident_span = self . last_span ;
3656- let path = ast:: Path :: from_ident ( ident_span, ident) ;
3659+ let path = self . parse_ident_into_path ( ) ?;
36573660 self . bump ( ) ;
36583661 let delim = self . expect_open_delim ( ) ?;
36593662 let tts = self . parse_seq_to_end (
@@ -3673,7 +3676,7 @@ impl<'a> Parser<'a> {
36733676 let ( qself, path) = if self . eat_lt ( ) {
36743677 // Parse a qualified path
36753678 let ( qself, path) =
3676- self . parse_qualified_path ( NoTypesAllowed ) ?;
3679+ self . parse_qualified_path ( LifetimeAndTypesWithColons ) ?;
36773680 ( Some ( qself) , path)
36783681 } else {
36793682 // Parse an unqualified path
@@ -3936,7 +3939,7 @@ impl<'a> Parser<'a> {
39363939
39373940 // Potential trouble: if we allow macros with paths instead of
39383941 // idents, we'd need to look ahead past the whole path here...
3939- let pth = self . parse_path ( NoTypesAllowed ) ?;
3942+ let pth = self . parse_ident_into_path ( ) ?;
39403943 self . bump ( ) ;
39413944
39423945 let id = match self . token {
@@ -4956,7 +4959,7 @@ impl<'a> Parser<'a> {
49564959 self . complain_if_pub_macro ( & vis, last_span) ;
49574960
49584961 let lo = self . span . lo ;
4959- let pth = self . parse_path ( NoTypesAllowed ) ?;
4962+ let pth = self . parse_ident_into_path ( ) ?;
49604963 self . expect ( & token:: Not ) ?;
49614964
49624965 // eat a matched-delimiter token tree:
@@ -6009,7 +6012,7 @@ impl<'a> Parser<'a> {
60096012 let mac_lo = self . span . lo ;
60106013
60116014 // item macro.
6012- let pth = self . parse_path ( NoTypesAllowed ) ?;
6015+ let pth = self . parse_ident_into_path ( ) ?;
60136016 self . expect ( & token:: Not ) ?;
60146017
60156018 // a 'special' identifier (like what `macro_rules!` uses)
0 commit comments