Use elaborated item bounds for alias types
This commit is contained in:
parent
8dadd54f52
commit
8c67ecd124
@ -399,10 +399,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
|||||||
ty::Alias(_, alias_ty) => alias_ty,
|
ty::Alias(_, alias_ty) => alias_ty,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (assumption, _) in self
|
for assumption in self.tcx().item_bounds(alias_ty.def_id).subst(self.tcx(), alias_ty.substs)
|
||||||
.tcx()
|
|
||||||
.bound_explicit_item_bounds(alias_ty.def_id)
|
|
||||||
.subst_iter_copied(self.tcx(), alias_ty.substs)
|
|
||||||
{
|
{
|
||||||
match G::consider_assumption(self, goal, assumption) {
|
match G::consider_assumption(self, goal, assumption) {
|
||||||
Ok(result) => {
|
Ok(result) => {
|
||||||
|
12
tests/ui/traits/new-solver/elaborate-item-bounds.rs
Normal file
12
tests/ui/traits/new-solver/elaborate-item-bounds.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// compile-flags: -Ztrait-solver=next
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
trait Foo {
|
||||||
|
type Bar: Bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
trait Bar: Baz {}
|
||||||
|
|
||||||
|
trait Baz {}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user