File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -2156,12 +2156,6 @@ impl<'a> Parser<'a> {
2156
2156
let lo = self . last_span . lo ;
2157
2157
return self . parse_while_expr ( None , lo, attrs) ;
2158
2158
}
2159
- if self . token . is_keyword ( keywords:: Let ) {
2160
- // Catch this syntax error here, instead of in `check_strict_keywords`, so
2161
- // that we can explicitly mention that let is not to be used as an expression
2162
- let msg = "`let` is not an expression, so it cannot be used in this way" ;
2163
- self . span_err ( self . span , msg) ;
2164
- }
2165
2159
if self . token . is_lifetime ( ) {
2166
2160
let lifetime = self . get_lifetime ( ) ;
2167
2161
let lo = self . span . lo ;
@@ -2224,6 +2218,11 @@ impl<'a> Parser<'a> {
2224
2218
ex = ExprBreak ( None ) ;
2225
2219
}
2226
2220
hi = self . last_span . hi ;
2221
+ } else if self . token . is_keyword ( keywords:: Let ) {
2222
+ // Catch this syntax error here, instead of in `check_strict_keywords`, so
2223
+ // that we can explicitly mention that let is not to be used as an expression
2224
+ let msg = "`let` is not an expression, so it cannot be used in this way" ;
2225
+ return Err ( self . fatal ( & msg) ) ;
2227
2226
} else if self . check ( & token:: ModSep ) ||
2228
2227
self . token . is_ident ( ) &&
2229
2228
!self . check_keyword ( keywords:: True ) &&
You can’t perform that action at this time.
0 commit comments