Skip to content

Commit a447e66

Browse files
Use elaborated item bounds for alias types
1 parent 55330f6 commit a447e66

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

compiler/rustc_trait_selection/src/solve/assembly.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
399399
ty::Alias(_, alias_ty) => alias_ty,
400400
};
401401

402-
for (assumption, _) in self
403-
.tcx()
404-
.bound_explicit_item_bounds(alias_ty.def_id)
405-
.subst_iter_copied(self.tcx(), alias_ty.substs)
402+
for assumption in self.tcx().item_bounds(alias_ty.def_id).subst(self.tcx(), alias_ty.substs)
406403
{
407404
match G::consider_assumption(self, goal, assumption) {
408405
Ok(result) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -Ztrait-solver=next
2+
// check-pass
3+
4+
trait Foo {
5+
type Bar: Bar;
6+
}
7+
8+
trait Bar: Baz {}
9+
10+
trait Baz {}
11+
12+
fn main() {}

0 commit comments

Comments
 (0)