-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Check item bounds for projection clause wellformedness #150662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
af69d7d to
6939aa1
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
☔ The latest upstream changes (presumably #150844) made this pull request unmergeable. Please resolve the merge conflicts. |
| region_mapping: FxHashMap<ty::Region<'tcx>, ty::Region<'tcx>>, | ||
| const_mapping: FxHashMap<ty::Const<'tcx>, ty::Const<'tcx>>, | ||
| } | ||
| impl<'tcx> PredicateArgFolder<'tcx> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this folder differ from whatever.instantiate(projection.projection_term.args)? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
{}
Experiment for #149283.
Blocked on some fatal regressions.
r? @ghost