-
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
Associated type regression? unable to infer enough type information about _
#28871
Comments
This is the ParamCandidate vs. ProjectionCandidate issue in Maybe just apply them all (and enjoy the type-errors on inconsistency) if there are no inference variables - as |
I suppose we ought to, yes, for consistency. I imagine the same forces that favor where clauses (helping along inference) will play out here too. |
This will hit stable in a little over a week. |
cc @rust-lang/compiler @rust-lang/lang |
It's not as simple as preferring where-clauses over impls. There are in fact two relevant where-clauses included in the environment, one with |
I think the problem derives from the fact that |
(Also, this is caused by the RFC 1214 changes, which are checking for WF'd-ness, which is where the error occurs.) |
So, while this example is a regression, the underlying problem is pre-existing. For example, this test case shows the same conflict (note that the compilation error goes away if you change @arcnmx I am curious whether you have some larger context for this minified example. |
I was thinking of just picking all where-clauses and projections when there are no inference variables involved. "guessing" in projections is stupid anyway. |
projection just uses I would prefer that we make projection not generate unneeded candidates - a projection predicate should always be coupled with some proof of the relevant selection predicate holding. |
@arielb1 certainly just converting to use
Do you mean that we should fully evaluate all nested obligations? This isn't always possible if there are inference variables, of course. |
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to rust-lang#28871.
@nikomatsakis there's not much greater context, really. I was using a trait as a sort of "static" compile-time enforced API, so type aliases to |
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to rust-lang#28871.
Fixed by #29241. |
@arcnmx thanks |
rustc seems to accept this under stable, but not beta or nightly.
playpen repro
The text was updated successfully, but these errors were encountered: