Closed
Description
fn main() {
let x = 100;
println!("{}", x)
let y = 200;
println!("{}", y)
}
The current output is:
error: expected one of `.`, `;`, `?`, `}`, or an operator, found keyword `let`
--> src/main.rs:4:5
|
3 | println!("{}", x)
| - expected one of `.`, `;`, `?`, `}`, or an operator
4 | let y = 200;
| ^^^ unexpected token
We should detect cases where a semicolon would be appropriate (probe that the current token and maybe limited lookahead confirm that what comes next could be a valid statement on its own) and suggest a semicolon. If there is a missing }
, we already suggest that it might belong there. We might want to silence one or the other depending on whether the current token might be starting a statement or an item (let
vs struct
, etc.).