Make sure type_param_predicates resolves correctly for RPITIT#132373
Merged
bors merged 1 commit intorust-lang:masterfrom Oct 31, 2024
Merged
Make sure type_param_predicates resolves correctly for RPITIT#132373bors merged 1 commit intorust-lang:masterfrom
type_param_predicates resolves correctly for RPITIT#132373bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @davidtwco rustbot has assigned @davidtwco. Use |
Contributor
Author
|
Maybe one of @spastorino or @fmease could review this? Otherwise nbd. |
fmease
approved these changes
Oct 30, 2024
Member
|
Thanks! @bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 31, 2024
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#132368 (Remove `do_not_const_check` from `Iterator` methods) - rust-lang#132373 (Make sure `type_param_predicates` resolves correctly for RPITIT) - rust-lang#132374 (Remove dead code stemming from the old effects desugaring) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 31, 2024
Rollup merge of rust-lang#132373 - compiler-errors:rpitit-bound, r=fmease Make sure `type_param_predicates` resolves correctly for RPITIT After rust-lang#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 the `type_param_predicates` function with the `item_def_id` of the *GAT* and not the opaque. That function operates on the HIR, and is not designed to work with the `Node::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 rust-lang#132372
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.
After #132194, we end up lowering the item bounds for an RPITIT in an
ItemCtxtwhose 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_predicatesfunction with theitem_def_idof the GAT and not the opaque. That function operates on the HIR, and is not designed to work with theNode::Syntheticthat 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