-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Trait selection treats unboxed closure arguments as quasi-associated types #20872
Comments
prob makes sense to fix this together with #20871 |
Can this also be a reason for #20770 (closures behaving as if they were the same, no matter the argument differences)? |
@Nercury I think that this comment is an accurate summary of the problem there. |
Ok, sorry, I am just completely lost :( |
@nikomatsakis struct A;
impl Fn(isize,isize) for A {
extern "rust-call" fn call(&self, args: (isize,isize)) {
....
}
}
impl Fn(isize) for A {
extern "rust-call" fn call(&self, args: (isize,)) {
self(args.0, args.0)
// error: the type of this value must be known in this context
// self(args.0 args.0)
// error: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit [E0059]
}
} but UFCS is usable: impl Fn(isize) for A {
extern "rust-call" fn call(&self, args: (isize,)) {
Fn::<(isize,isize)>::call(self, (args.0,args.0))
}
} |
I don't think this is relevant today. |
Triage: Gonna trust @arielb1 and give this a close; feel free to re-open if this is wrong. |
Currently trait selection treats unboxed closure arg/ret types as quasi-associated types. It's weird and hard to explain. It should change. I don't expect much impact although error messages might get less good; we should consider working on that.
The text was updated successfully, but these errors were encountered: