File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
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: d829019ff4874e2a4f1b6780c442dfa524e75d38
32
+ refs/heads/stable: 065e47eb3b23a9bd3074d3406157f0aafc575150
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 @@ -2221,8 +2221,9 @@ impl<'a> Parser<'a> {
2221
2221
} else if self . token . is_keyword ( keywords:: Let ) {
2222
2222
// Catch this syntax error here, instead of in `check_strict_keywords`, so
2223
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) ) ;
2224
+ let mut db = self . fatal ( "expected expression, found statement (`let`)" ) ;
2225
+ db. note ( "variable declaration using `let` is a statement" ) ;
2226
+ return Err ( db) ;
2226
2227
} else if self . check ( & token:: ModSep ) ||
2227
2228
self . token . is_ident ( ) &&
2228
2229
!self . check_keyword ( keywords:: True ) &&
Original file line number Diff line number Diff line change 10
10
11
11
// ignore-cross-compile
12
12
13
- // error-pattern:`let` is not an expression, so it cannot be used in this way
13
+ // error-pattern:expected expression, found statement (`let`)
14
14
15
15
#![ feature( quote, rustc_private) ]
16
16
You can’t perform that action at this time.
0 commit comments