about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-04-02 15:09:43 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-04-02 15:09:43 +0300
commit76567a64c1df7881ccd46d790108d9ec768b4c0c (patch)
tree848edefe9ed0caf04f41dd6d6caa3a60b2300bdf /src/libsyntax/parse
parent35c1bdb2b44afd11603ec7bff6f31e6b4990699b (diff)
downloadrust-76567a64c1df7881ccd46d790108d9ec768b4c0c.tar.gz
rust-76567a64c1df7881ccd46d790108d9ec768b4c0c.zip
Fix parsing of patterns in macros
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index cb7b93d2ef2..62c03f0e12e 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