-
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 (playground):
fn f() -> f32 {
3
5.0
}
fn main() {
}
The current output is:
error: expected `;`, found `5.0`
--> epp.rs:2:6
|
2 | 3
| ^ help: add `;` here
3 | 5.0
| --- unexpected token
error[E0308]: mismatched types
--> epp.rs:2:5
|
2 | 3
| ^ expected `()`, found integer
What is this second error trying to tell me? What did it expect to be unit type and why? Does it make sense for this error to be emitted despite the first error correctly identifying my problem?
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.