Skip to content

Commit b840eb1

Browse files
committed
let_chains: Comment out Let in ident_can_begin_expr.
1 parent d5a1621 commit b840eb1

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Diff for: src/libsyntax/parse/token.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {
122122
keywords::Continue.name(),
123123
keywords::False.name(),
124124
keywords::For.name(),
125-
keywords::Let.name(),
125+
// FIXME(53667): Consider whether `Let` can be added here.
126+
// keywords::Let.name(),
126127
keywords::If.name(),
127128
keywords::Loop.name(),
128129
keywords::Match.name(),

Diff for: src/test/ui/rfc-2497-if-let-chains/feature-gate.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ fn _macros() {
9191
while $e {}
9292
}
9393
}
94-
use_expr!(let 0 = 1 && 0 == 0);
94+
use_expr!((let 0 = 1 && 0 == 0));
9595
//~^ ERROR `let` expressions in this position are experimental [E0658]
9696
use_expr!((let 0 = 1));
9797
//~^ ERROR `let` expressions in this position are experimental [E0658]
98-
use_expr!(let 0 = 1);
98+
// use_expr!(let 0 = 1);
99+
// ^--- FIXME(53667): Consider whether `Let` can be added to `ident_can_begin_expr`.
99100
}
100101

101102
fn main() {}

Diff for: src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ LL | while let Range { start: _, end: _ } = (true..true) && false {}
251251
= help: add #![feature(let_chains)] to the crate attributes to enable
252252

253253
error[E0658]: `let` expressions in this position are experimental
254-
--> $DIR/feature-gate.rs:94:15
254+
--> $DIR/feature-gate.rs:94:16
255255
|
256-
LL | use_expr!(let 0 = 1 && 0 == 0);
257-
| ^^^^^^^^^
256+
LL | use_expr!((let 0 = 1 && 0 == 0));
257+
| ^^^^^^^^^
258258
|
259259
= note: for more information, see https://github.com/rust-lang/rust/issues/53667
260260
= help: add #![feature(let_chains)] to the crate attributes to enable

0 commit comments

Comments
 (0)