Closed
Description
As a newcomer to Rust, sometimes I forget fn
before main()
and the error message doesn't make sense in this instance:
Example file:
main() {
}
Error message
error: expected one of `!` or `::`, found `(`
--> examples/tuple.rs:1:5
|
1 | main() {
| ^ expected one of `!` or `::` here
suggested change:
"^ expected prior fn
for a function declaration or suffix !
for a macro"
I'm not familiar with a case where ::
would make sense here without other changes too.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint; hard to understand for new users.Relevant to the compiler team, which will review and decide on the PR/issue.