-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Poor error for manual implementations of function traits #39259
Comments
cc @jrmuizel |
It is sort of actionable if you know that |
This code now produces two confusing errors: #![feature(fn_traits)]
#![feature(unboxed_closures)]
struct S;
impl Fn(u32) -> u32 for S {
fn call(&self) -> u32 {
5
}
}
fn main() {}
In the first one, the erroneous span has moved inside of the parentheses, so I feel it's no longer as correct as it used to be, and no more helpful. And the second one just seems... incorrect? Idk, I'm not intimately familiar with this nightly feature. @rustbot label +D-confusing +D-terse +requires-nightly +D-incorrect |
Current output:
|
My understanding of this issue is that the Two issues currently seem to exist:
I'll work on 1. 2 seems out of scope of this issue. @rustbot claim |
@Ezrashaw if you're able to detect that you've got |
@estebank Isn't that suggestion generic to all "assoc type not allowed here" error? |
Come to think of it, It would be. |
Hmm, @estebank I think I've run into a problem: I cannot print the type. The error occurs is emitted from |
Because this is a nightly feature, I would side step the issue by not mentioning the type for now and only mention the "represent the closure with the regular trait syntax instead and move the output |
This yields:
Which is extremely confusing and non-actionable.
The text was updated successfully, but these errors were encountered: