Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use elaborated item bounds for alias types
  • Loading branch information
compiler-errors committed Feb 9, 2023
commit 8c67ecd1245daef98a2667bd1672fe47ff16927a
5 changes: 1 addition & 4 deletions compiler/rustc_trait_selection/src/solve/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/traits/new-solver/elaborate-item-bounds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// compile-flags: -Ztrait-solver=next
// check-pass

trait Foo {
type Bar: Bar;
}

trait Bar: Baz {}

trait Baz {}

fn main() {}