Make sure type_param_predicates
resolves correctly for RPITIT
#132373
+23
−0
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.
After #132194, we end up lowering the item bounds for an RPITIT in an
ItemCtxt
whose def id is the synthetic GAT, not the opaque type from the HIR.This means that when we're resolving a shorthand projection like
T::Assoc
, we call thetype_param_predicates
function with theitem_def_id
of the GAT and not the opaque. That function operates on the HIR, and is not designed to work with theNode::Synthetic
that gets fed for items synthesized by the compiler...This PR reuses the trick we use elsewhere in lowering, where we intercept whether an item comes from RPITIT lowering, and forwards the query off to the correct item.
Fixes #132372