* Recover from invalid `'label: ` before block.
* Make suggestion to enclose statements in a block multipart.
* Point at `match`, `while`, `loop` and `unsafe` keywords when failing
to parse their expression.
* Do not suggest `{ ; }`.
* Do not suggest `|` when very unlikely to be what was wanted (in `let`
statements).
13 lines
376 B
Rust
13 lines
376 B
Rust
fn main() {
|
|
let container = vec![Some(1), Some(2), None];
|
|
|
|
let mut i = 0;
|
|
while if let Some(thing) = container.get(i) {
|
|
//~^ NOTE while parsing the body of this `while` expression
|
|
//~| NOTE this `while` condition successfully parsed
|
|
println!("{:?}", thing);
|
|
i += 1;
|
|
}
|
|
}
|
|
//~^ ERROR expected `{`, found `}`
|
|
//~| NOTE expected `{`
|