ac037c1359
When encountering one of a few keywords when a semicolon was expected, suggest the semicolon and recover: ``` error: expected one of `.`, `;`, `?`, or an operator, found `let` --> $DIR/recover-missing-semi.rs:4:5 | LL | let _: usize = () | - help: missing semicolon here LL | LL | let _ = 3; | ^^^ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () | ^^ expected usize, found () | = note: expected type `usize` found type `()` ```
14 lines
236 B
Rust
14 lines
236 B
Rust
fn main() {
|
|
let _: usize = ()
|
|
//~^ ERROR mismatched types
|
|
let _ = 3;
|
|
//~^ ERROR expected one of
|
|
}
|
|
|
|
fn foo() -> usize {
|
|
let _: usize = ()
|
|
//~^ ERROR mismatched types
|
|
return 3;
|
|
//~^ ERROR expected one of
|
|
}
|