-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code: link
const x: i32 = 123
fn main() {
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected one of `.`, `;`, `?`, or an operator, found keyword `fn`
--> src/main.rs:3:1
|
1 | const x: i32 = 123
| - expected one of `.`, `;`, `?`, or an operator
2 |
3 | fn main() {
| ^^ unexpected token
error: could not compile `playground` due to previous error
Ideally the output should suggest putting a semicolon at the end of the declaration, since that suggestion is present if that declaration is placed in the main function.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.