Use elaborated item bounds for alias types

This commit is contained in:
Michael Goulet 2023-02-08 02:46:22 +00:00
parent 8dadd54f52
commit 8c67ecd124
2 changed files with 13 additions and 4 deletions

View File

@ -399,10 +399,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
ty::Alias(_, alias_ty) => alias_ty,
};
for (assumption, _) in self
.tcx()
.bound_explicit_item_bounds(alias_ty.def_id)
.subst_iter_copied(self.tcx(), alias_ty.substs)
for assumption in self.tcx().item_bounds(alias_ty.def_id).subst(self.tcx(), alias_ty.substs)
{
match G::consider_assumption(self, goal, assumption) {
Ok(result) => {

View File

@ -0,0 +1,12 @@
// compile-flags: -Ztrait-solver=next
// check-pass
trait Foo {
type Bar: Bar;
}
trait Bar: Baz {}
trait Baz {}
fn main() {}