Support type-relative assoc item paths in generic param defaults & const param types - #161998
Open
fmease wants to merge 2 commits into
Open
Support type-relative assoc item paths in generic param defaults & const param types#161998fmease wants to merge 2 commits into
fmease wants to merge 2 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
r? types |
Member
Author
|
@rfcbot merge types |
Collaborator
|
@fmease has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Member
Author
|
Not sure if this needs an FCP but it felt "significant" enough. Since there's no breakage AFAIK & it's a bit niche, this might also be considered a trivial bugfix in which case I'm sorry for the team ping ^^' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background info: For resolving type-relative associated item paths, we only support a tiny set of self types (cc #22519). If it's a non-
Selftype parameter we look at the "type param bounds" of the overarching item.However, in the case of generic parameter defaults and const parameter types this overarching "item" was set to the generic parameter. This meant that in these places we didn't look at the bounds of the overarching item when trying to resolve such type-relative associated item paths and thus failed unconditionally.
Fixes #87682.
For the types FCP: This PR makes us accept the following code (stably):
As alluded to, this PR also affects the resolution in const param defaults+types (intentionally, of course). However, I don't think this can be observed without the use of unstable features (like
min_generic_const_argsandgeneric_const_parameter_types). Nonetheless if you're interested in that, too, please check out the added UI tests.To the best of my knowledge this change doesn't make us reject more code (via new ambiguities or query cycles for example).
(No LLM was or will be used by me during the entire creation process of this PR)