let_chains: note re. back-compat wrt. expr beginning.

This commit is contained in:
Mazdak Farrokhzad 2019-06-23 01:41:09 +02:00
parent 7abb2350df
commit c75f7ecaee

View file

@ -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(),