-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message inconsistent #26576
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Same error, one case give help message. The other doesn't. It all depend of the return type. Expected: to get the help message. |
This was found during the Tutorial session at #mozwww |
steveklabnik
added
the
A-diagnostics
Area: Messages for errors, warnings, and lints
label
Jun 25, 2015
Tricky! |
This occurs because of integer fallback ( |
steveklabnik
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Mar 9, 2017
This is fixed in stable: rustc 1.15.1 (021bd294c 2017-02-08)
error[E0308]: mismatched types
--> <anon>:1:17
|
1 | fn foo() -> i32 {
| _________________^ starting here...
2 | | 22;
3 | | }
| |_^ ...ending here: expected i32, found ()
|
= note: expected type `i32`
= note: found type `()`
help: consider removing this semicolon:
--> <anon>:2:7
|
2 | 22;
| ^
error[E0308]: mismatched types
--> <anon>:5:18
|
5 | fn foo2() -> u32 {
| __________________^ starting here...
6 | | 22;
7 | | }
| |_^ ...ending here: expected u32, found ()
|
= note: expected type `u32`
= note: found type `()`
help: consider removing this semicolon:
--> <anon>:6:7
|
6 | 22;
| ^
error: aborting due to 2 previous errors |
Closing as per the previous comment; this is now fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Try to compile the following message:
The text was updated successfully, but these errors were encountered: