Check item bounds for projection clause wellformedness #150662
Draft
adwinwhite wants to merge 1 commit intorust-lang:mainfrom
Draft
Check item bounds for projection clause wellformedness #150662adwinwhite wants to merge 1 commit intorust-lang:mainfrom
adwinwhite wants to merge 1 commit intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
af69d7d to
6939aa1
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
|
☔ The latest upstream changes (presumably #150844) made this pull request unmergeable. Please resolve the merge conflicts. |
lcnr
reviewed
Jan 20, 2026
| region_mapping: FxHashMap<ty::Region<'tcx>, ty::Region<'tcx>>, | ||
| const_mapping: FxHashMap<ty::Const<'tcx>, ty::Const<'tcx>>, | ||
| } | ||
| impl<'tcx> PredicateArgFolder<'tcx> { |
Contributor
There was a problem hiding this comment.
how does this folder differ from whatever.instantiate(projection.projection_term.args)? 🤔
Contributor
Author
There was a problem hiding this comment.
This folder additionally maps identity projection alias to the rhs type of the projection: Self::Assoc -> projection.term. It's needed to apply the item bounds on projection.term.
E.g.
trait Trait<T> {
type Assoc: Bound<T>;
}
fn function<T, U, I>()
where
// We need to transform `Self::Assoc: Bound<T>` into `U: Bound<I>`.
// With instantiating alone, the result would be `T::Assoc: Bound<I>`, which is pointless
// as `AliasBound` candidate already covers this.
T: Trait<I, Assoc = U>
{}6939aa1 to
8e8010e
Compare
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.
Experiment for #149283.
There're some fatal regressions.
Preparing to run crater to find out the range of breakages.
r? @ghost