File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
branches/stable/src/libsyntax/parse Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: 2b1e2732930830fc295d26bfb4bb29931e7e84ac
32
+ refs/heads/stable: 1745153eaeeb0793876b36422bda6764483ceefb
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
34
34
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
35
35
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e
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