Skip to content

Commit 76567a6

Browse files
committed
Fix parsing of patterns in macros
1 parent 35c1bdb commit 76567a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libsyntax/parse/parser.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,9 @@ impl<'a> Parser<'a> {
31603160
// Parse pattern starting with a path
31613161
if self.token.is_plain_ident() && self.look_ahead(1, |t| *t != token::DotDotDot &&
31623162
*t != token::OpenDelim(token::Brace) &&
3163-
*t != token::OpenDelim(token::Paren)) {
3163+
*t != token::OpenDelim(token::Paren) &&
3164+
// Contrary to its definition, a plain ident can be followed by :: in macros
3165+
*t != token::ModSep) {
31643166
// Plain idents have some extra abilities here compared to general paths
31653167
if self.look_ahead(1, |t| *t == token::Not) {
31663168
// Parse macro invocation

0 commit comments

Comments
 (0)