Skip to content

Commit

Permalink
let_chains: Comment out Let in ident_can_begin_expr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed May 16, 2019
1 parent d5a1621 commit b840eb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/libsyntax/parse/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {
keywords::Continue.name(),
keywords::False.name(),
keywords::For.name(),
keywords::Let.name(),
// FIXME(53667): Consider whether `Let` can be added here.
// keywords::Let.name(),
keywords::If.name(),
keywords::Loop.name(),
keywords::Match.name(),
Expand Down
5 changes: 3 additions & 2 deletions src/test/ui/rfc-2497-if-let-chains/feature-gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ fn _macros() {
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() {}
6 changes: 3 additions & 3 deletions src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b840eb1

Please sign in to comment.