From 76567a64c1df7881ccd46d790108d9ec768b4c0c Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 2 Apr 2015 15:09:43 +0300 Subject: [PATCH] Fix parsing of patterns in macros --- src/libsyntax/parse/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cb7b93d2ef24..62c03f0e12e3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3160,7 +3160,9 @@ impl<'a> Parser<'a> { // Parse pattern starting with a path if self.token.is_plain_ident() && self.look_ahead(1, |t| *t != token::DotDotDot && *t != token::OpenDelim(token::Brace) && - *t != token::OpenDelim(token::Paren)) { + *t != token::OpenDelim(token::Paren) && + // Contrary to its definition, a plain ident can be followed by :: in macros + *t != token::ModSep) { // Plain idents have some extra abilities here compared to general paths if self.look_ahead(1, |t| *t == token::Not) { // Parse macro invocation