-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Error message "mismatched types" has wrong types #41425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I believe this was introduced by #40224, specifically this line. Swapping the items in that tuple reflects the expected output: error[E0308]: mismatched types
--> file.rs:11:28
|
11 | fn plus_one(x: i32) -> i32 {
| ____________________________^
12 | | x + 1;
13 | | }
| |_^ expected (), found i32
|
= note: expected type `i32`
found type `()` |
Hmm, yes. Well, you certainly can't change just that one line, because it is correct in most other cases. The flawed assumption here is that the "forced unit" case means that @estebank correctly identified the problem here. The coercion code includes a function called To account for this, I think we need to add a parameter to Naturally, we will need to change the callers to
Meanwhile, when an error occurs, we will not check if After that, we just want to add a Tagged as E-mentor. If you're interested, please leave a comment to let others know you are working on it! Feel free to ask questions here or to find me on IRC ( |
Hi there! I'd like to try implementing this. |
@alexeyzab great! let me know how it goes =) |
This addresses rust-lang#41425 by implementing the changes mentioned in the following comment: rust-lang#41425 (comment)
@nikomatsakis I've added the changes you mentioned, seems to work correctly. Let me know if I should change anything in my PR. Thanks for explaining everything! :) |
…sage, r=arielb1 Fix error message for mismatched types This addresses #41425 by implementing the changes mentioned in the following comment: #41425 (comment)
Looks like this issue has been resolved. Can someone close this please, so that people looking for issues to work on can skip this. Thanks. |
Uh oh!
There was an error while loading. Please reload this page.
UPDATE: If you are interested in fixing this bug, there are mentoring instructions in this comment below.
I think that types in "expected type
()
found typei32
" needs to be exchangedThe text was updated successfully, but these errors were encountered: