let_chains: Comment out Let in ident_can_begin_expr.

This commit is contained in:
Mazdak Farrokhzad 2019-05-16 14:17:10 +02:00
parent 530f954e92
commit 86250a666e
3 changed files with 8 additions and 6 deletions

View File

@ -134,8 +134,9 @@ pub(crate) fn ident_can_begin_expr(name: ast::Name, span: Span, is_raw: bool) ->
kw::Continue,
kw::False,
kw::For,
kw::Let,
kw::If,
// FIXME(53667): Consider whether `Let` can be added here.
// kw::Let,
kw::Loop,
kw::Match,
kw::Move,

View File

@ -91,11 +91,12 @@ macro_rules! use_expr {
while $e {}
}
}
use_expr!(let 0 = 1 && 0 == 0);
use_expr!((let 0 = 1 && 0 == 0));
//~^ ERROR `let` expressions in this position are experimental [E0658]
use_expr!((let 0 = 1));
//~^ ERROR `let` expressions in this position are experimental [E0658]
use_expr!(let 0 = 1);
// use_expr!(let 0 = 1);
// ^--- FIXME(53667): Consider whether `Let` can be added to `ident_can_begin_expr`.
}
fn main() {}

View File

@ -251,10 +251,10 @@ LL | while let Range { start: _, end: _ } = (true..true) && false {}
= help: add #![feature(let_chains)] to the crate attributes to enable
error[E0658]: `let` expressions in this position are experimental
--> $DIR/feature-gate.rs:94:15
--> $DIR/feature-gate.rs:94:16
|
LL | use_expr!(let 0 = 1 && 0 == 0);
| ^^^^^^^^^
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/53667
= help: add #![feature(let_chains)] to the crate attributes to enable