Skip to content

Don't normalize xform_ret_ty during method candidate assembly #86506

Merged
bors merged 2 commits intorust-lang:masterfrom
b-naber:gen_trait_impl_inconsistent
Oct 9, 2021
Merged

Don't normalize xform_ret_ty during method candidate assembly #86506
bors merged 2 commits intorust-lang:masterfrom
b-naber:gen_trait_impl_inconsistent

Conversation

@b-naber
Copy link
Contributor

@b-naber b-naber commented Jun 21, 2021

Fixes #85671

Normalizing the return type of a method candidate together with the expected receiver type of the method can lead to valid method candidates being rejected during probing. Specifically in the example of the fixed issue we have a self_ty of the form &A<&[Coef]> whereas the impl_ty of the method would be &A<_>, if we normalize the projection in the return type we unify the inference variable with Cont, which will lead us to reject the candidate in the sup type check in consider_probe. Since we don't actually need the normalized return type during candidate assembly, we postpone the normalization until we consider candidates in consider_probe.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic trait implementation not consistently recognized by the compiler

10 participants