-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WIP: Fix unexpected E0110 when using GATs #51589
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
WIP: Fix unexpected E0110 when using GATs #51589
Conversation
In two places parameters were just prohibited. These were replaced a check for the right number of lifetime and type parameters. Right now, a few UI tests cause an ICE, because the errors that were created in an earlier stage are not created anymore.
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
} | ||
check_type_argument_count(tcx, span, ty_provided, ty_params); | ||
|
||
|
||
let ty = self.projected_ty_from_poly_trait_ref(span, item.def_id, bound); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see what's missing here - projected_ty_from_poly_trait_ref
should not exist. create_substs_for_ast_path
should be used, and it now needs to handle multiple segments containing parameters, which is unprecedenced.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Progress in this area is blocked on #48149, which will make extending |
☔ The latest upstream changes (presumably #48149) made this pull request unmergeable. Please resolve the merge conflicts. |
I will just close this PR. This was just an attempt to start something GAT related on my own. But as I have learned, these changes should be part of a bigger cleanup of several modules, including |
This PR fixes what @nikomatsakis describes in this comment. Prior to this change, parameters to a path segment were completely prohibited in two places. This resulted in incorrect errors E0110 ("lifetime parameter not allowed on this type") and E0109 ("type parameter not allowed"). I changed this to check the number of allowed/required lifetime and type parameters instead.
This PR can't be merged yet for two reasons:
TODO
comment on a line which prohibits type parameters for all but the second two segments of a path. I don't understand why it is there and I'd say it can be removed. However, I'm not sure and I guess there might be a good reason for that, even with GATs?CC #44265 @eddyb @scalexm