diff options
| author | P1start <rewi-github@whanau.org> | 2014-12-03 22:47:53 +1300 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-12-04 13:47:35 +1300 |
| commit | 108bca53f04342a4626b34ac1d5b8236d170a12a (patch) | |
| tree | aae9d6fe5650fbe061c011e6f77e8d386627cb69 /src/test/compile-fail/removed-syntax-mut-vec-expr.rs | |
| parent | 3a325c666d2cb7e297bf3057ff2442f96a79428b (diff) | |
| download | rust-108bca53f04342a4626b34ac1d5b8236d170a12a.tar.gz rust-108bca53f04342a4626b34ac1d5b8236d170a12a.zip | |
Make the parser’s ‘expected <foo>, found <bar>’ errors more accurate
As an example of what this changes, the following code:
let x: [int ..4];
Currently spits out ‘expected `]`, found `..`’. However, a comma would also be
valid there, as would a number of other tokens. This change adjusts the parser
to produce more accurate errors, so that that example now produces ‘expected one
of `(`, `+`, `,`, `::`, or `]`, found `..`’.
Diffstat (limited to 'src/test/compile-fail/removed-syntax-mut-vec-expr.rs')
| -rw-r--r-- | src/test/compile-fail/removed-syntax-mut-vec-expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/compile-fail/removed-syntax-mut-vec-expr.rs b/src/test/compile-fail/removed-syntax-mut-vec-expr.rs index b20da6346f7..437f871f8ea 100644 --- a/src/test/compile-fail/removed-syntax-mut-vec-expr.rs +++ b/src/test/compile-fail/removed-syntax-mut-vec-expr.rs @@ -11,5 +11,5 @@ fn f() { let v = [mut 1, 2, 3, 4]; //~^ ERROR expected identifier, found keyword `mut` - //~^^ ERROR expected `]`, found `1` + //~^^ ERROR expected one of `!`, `,`, `.`, `::`, `]`, `{`, or an operator, found `1` } |
