about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-23 01:41:09 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-06-23 01:41:09 +0200
commitc75f7ecaee508c568c0bc01c102965ce8b2246ef (patch)
treec59e8fbe99bed1ddf64306ad4c09f32ddfc7daca
parent7abb2350df361effc0f2f4bad938c42547fbb8ed (diff)
downloadrust-c75f7ecaee508c568c0bc01c102965ce8b2246ef.tar.gz
rust-c75f7ecaee508c568c0bc01c102965ce8b2246ef.zip
let_chains: note re. back-compat wrt. expr beginning.
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 0db6bd59afc..92ce3779a3c 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -825,7 +825,9 @@ fn may_begin_with(token: &Token, name: Name) -> bool {
     }
 
     match name {
-        sym::expr => token.can_begin_expr() && !token.is_keyword(kw::Let),
+        sym::expr => token.can_begin_expr()
+            // This exception is here for backwards compatibility.
+            && !token.is_keyword(kw::Let),
         sym::ty => token.can_begin_type(),
         sym::ident => get_macro_name(token).is_some(),
         sym::literal => token.can_begin_literal_or_bool(),