Commit Graph

7 Commits

Author SHA1 Message Date
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Esteban Küber
d17e38f4bf struct pattern parsing and diagnostic tweaks
- Recover from struct parse error on match and point out missing match
   body.
 - Point at struct when finding non-identifier while parsing its fields.
 - Add label to "expected identifier, found {}" error.
2018-01-07 17:04:36 -08:00
Esteban Küber
aaf3e318fc Do not emit type errors on recovered blocks
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-21 14:57:42 -08:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Esteban Küber
9dc7abe06d Detect = -> : typo in let bindings
When encountering a let binding type error, attempt to parse as
initializer instead. If successful, it is likely just a typo:

```rust
fn main() {
    let x: Vec::with_capacity(10);
}
```

```
error: expected type, found `10`
 --> file.rs:3:31
  |
3 |     let x: Vec::with_capacity(10, 20);
  |         --                    ^^
  |         ||
  |         |help: did you mean assign here?: `=`
  |         while parsing the type for `x`
```
2017-11-03 17:39:16 -07:00
Vadim Petrochenkov
e6115af4bd Implement dyn Trait syntax 2017-10-14 12:51:13 +03:00
Vadim Petrochenkov
3e4d9df02b Fix a bug in diagnostics for x as usize < y
Improve diagnostics for `x as usize << y`
2017-10-09 20:02:37 +03:00