]> git.lizzy.rs Git - rust.git/commit
rollup merge of #19494: P1start/better-expected
authorCorey Richardson <corey@octayn.net>
Fri, 5 Dec 2014 18:07:36 +0000 (10:07 -0800)
committerCorey Richardson <corey@octayn.net>
Fri, 5 Dec 2014 18:07:36 +0000 (10:07 -0800)
commitfdb395626bc1180e1b643e43e8b9344c43fa6c0f
treea90040ec326270d8a4e613d0b29e983462df80ee
parent13befdff912250155cb5455ecce8291b162eae6b
parent108bca53f04342a4626b34ac1d5b8236d170a12a
rollup merge of #19494: P1start/better-expected

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.)
src/libsyntax/parse/parser.rs