WIP: Trust parameter env when projecting GATs #98742
Closed
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.
While investigating the behavior for GAT implied bounds, I realized that we were enforcing stricter requirements when projecting than I believe we should -- in particular, if the where-clause says "this is true for all
'a
", we should believe it.This fixes a lot of unnecessary errors from GATs, though not all (see the new test I added, which shows why this is still sound and reasonable).
However, it also may introduce a backwards incompatibility hazard, albeit a very unlikely one, in that we are going to modify the meaning of this where-clause, and hence some functions are accepted now that won't be accepted later, even though they aren't callable today.
r? @jackh726