Closed
Description
Many editors helpfully auto close delimiters when writing them down. It is not uncommon for this to cause the following to occur:
fn main() {}
let _ = ();
}
It'd be a good idea for the parser or lexer to keep track of these empty blocks to provide an error closer to
error: unexpected close delimiter: `}`
--> src/main.rs:3:1
|
1 | fn main() {}
| -- this block is empty, you might have not meant to close it
2 | let _ = ();
3 | }
| ^ unexpected close delimiter
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTArea: Suggestions generated by the compiler applied by `cargo fix`Category: An issue proposing an enhancement or a PR with one.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.