From 92587e41d9096bc9eb74f40b93422026a8a57d4e Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Mon, 17 Jun 2019 00:45:09 +0200 Subject: [PATCH] let_chains: readd kw::let to ident_can_begin_expr. --- src/libsyntax/ext/tt/macro_parser.rs | 2 +- src/libsyntax/parse/token.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index d5da4c920bc4..0db6bd59afc2 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -825,7 +825,7 @@ fn may_begin_with(token: &Token, name: Name) -> bool { } match name { - sym::expr => token.can_begin_expr(), + sym::expr => token.can_begin_expr() && !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(), diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index eec09c08702d..ebd0decacb59 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -135,8 +135,7 @@ pub(crate) fn ident_can_begin_expr(name: ast::Name, span: Span, is_raw: bool) -> kw::False, kw::For, kw::If, - // FIXME(53667): Consider whether `Let` can be added here. - // kw::Let, + kw::Let, kw::Loop, kw::Match, kw::Move,