-
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
select: treat ErrorCandidate as a real error #29954
Conversation
Travis failures seem real. |
Otherwise, projection can result in type errors that are unified into the trait inputs. We should probably refactor the `normalize_to_error` mess.
the problem is that now "type_is_known_to_be_sized" now returns false when called on a type with ty_err inside - this prevents spurious errors (we may want to move the check to check::cast anyway - see rust-lang#12894).
b7bed52
to
fd0bd39
Compare
fixed test failures. |
Hmm, I'm not sure about this change. I feel like this will potentially create more downstream fallout. Is it possible that the right fix to #29857 is just to change OTOH maybe it's ok to have trait selection fail and we just suppress the output of failed trait selection (which I know we attempt to do anyway). |
The problem is that |
However, I feel like putting a |
Sorry for the delay. Maybe my head just isn't in the right space anymore, but can you elaborate on this:
It still seems to me that converting an |
OK, so, given that this is a stable -> beta regression, we've got to reach some decision here. I still kind of feel like this is the wrong approach, and the right approach would be to tolerate errors in the coherence code (which feels like what we normally do -- consider errors a success). But it'd be helpful @arielb1 if you could elaborate on what you meant about "false positives" and so forth. |
I should really be reading my e-mails more often. The root cause of the problem here is |
No worries, me too. :)
So I think what you are saying here is that, but for |
Right. The |
@arielb1 while on vacation I was pondering this, and I was wondering if perhaps ignoring errors in coherence (as I have been suggesting) could lead to incorrect code being accepted? Still, it's not obvious to me how this could happen, I'd expect that such an error would be reported during the WF phase. Anyway, it's clear we have to land SOME patch here. I am going to briefly experiment with a patch that is more accepting of type-error today, then we can make a final decision. |
Ignoring errors in coherence should typically actually lead to less code being accepted, but this is still wrong. |
This is an alternative to #29954 for fixing #29857 that seems to me to be more inline with the general strategy around `TyError`. It also includes the fix for #30589 -- in fact, just the minimal change of making `ty_is_local` tolerate `TyError` avoids the ICE, but you get a lot of duplicate error reports, so in the case where the impl's trait reference already includes `TyError`, we just ignore the impl altogether. cc @arielb1 @sanxiyn Fixes #29857. Fixes #30589.
☔ The latest upstream changes (presumably #30676) made this pull request unmergeable. Please resolve the merge conflicts. |
Otherwise, projection can result in type errors that are unified
into the trait inputs. We should probably refactor the
normalize_to_error
mess.We could instead change
ctp::identify_constrained_type_params
to put a projection's desugar selection before the projection. Would you like that better?Fixes #29857.
r? @nikomatsakis