rust-lang/rust — pull request #19494 by P1start (2014-12-03 10:02:12+00:00)
Title: Make the parser’s ‘expected <foo>, found <bar>’ errors more accurate

As an example of what this changes, the following code:

```rust
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 `..`’.

(Thanks to cramer on IRC for pointing out this problem with diagnostics.)