about summary refs log tree commit diff
path: root/src/test/compile-fail/removed-syntax-mut-vec-expr.rs
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2014-12-03 22:47:53 +1300
committerP1start <rewi-github@whanau.org>2014-12-04 13:47:35 +1300
commit108bca53f04342a4626b34ac1d5b8236d170a12a (patch)
treeaae9d6fe5650fbe061c011e6f77e8d386627cb69 /src/test/compile-fail/removed-syntax-mut-vec-expr.rs
parent3a325c666d2cb7e297bf3057ff2442f96a79428b (diff)
downloadrust-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.rs2
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`
 }