-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Error about number of arguments, when number is correct but type is wrong #46295
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
cc @estebank Simpler reproduction, though still requiring the futures crate: https://play.rust-lang.org/?gist=2ff931e3b3f6ef7b7592d2d1f20a1e4c&version=stable |
(BTW, the type should be |
Never mind, my reduction is bogus and doesn't actually reproduce the problem. |
I think this is fixed in rust 1.22. The following code gives the same bogus error message about the closure arity with rust 1.21 but not with rust 1.22. fn main() {
let x: Result<i32, ()> = Ok(1);
x.map(|_: ()| ()).unwrap();
} |
@stephaneyfx thanks for the minimal repro. @djmitche, can you verify wether you see the same incorrect behaviour with your code in 1.22 or later? If you don't, we can close this ticket :) |
Indeed, I now see
Awesome :) |
I'm struggling with types in async code, and came across an error that was very misleading. I tried this code:
I expected to see an error that my closure on the line annotated with "XXX" has the wrong argument type.
Instead, this happened:
Meta
/cc @Mark-Simulacrum
The text was updated successfully, but these errors were encountered: