1
Fork 0

Changes from review

This commit is contained in:
Kyle Matsuda 2023-04-20 12:33:32 -06:00
parent e54854f6a9
commit 5a69b5d0f9
6 changed files with 25 additions and 20 deletions

View file

@ -50,12 +50,11 @@ impl<'tcx> RustIrDatabase<'tcx> {
where
ty::Predicate<'tcx>: LowerInto<'tcx, std::option::Option<T>>,
{
let bounds = self.interner.tcx.explicit_item_bounds(def_id);
bounds
.0
.iter()
.map(|(bound, _)| bounds.rebind(*bound).subst(self.interner.tcx, &bound_vars))
.filter_map(|bound| LowerInto::<Option<_>>::lower_into(bound, self.interner))
self.interner
.tcx
.explicit_item_bounds(def_id)
.subst_iter_copied(self.interner.tcx, &bound_vars)
.filter_map(|(bound, _)| LowerInto::<Option<_>>::lower_into(bound, self.interner))
.collect()
}
}
@ -509,12 +508,8 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
let explicit_item_bounds = self.interner.tcx.explicit_item_bounds(opaque_ty_id.0);
let bounds =
explicit_item_bounds
.0
.iter()
.subst_iter_copied(self.interner.tcx, &bound_vars)
.map(|(bound, _)| {
explicit_item_bounds.rebind(*bound).subst(self.interner.tcx, &bound_vars)
})
.map(|bound| {
bound.fold_with(&mut ReplaceOpaqueTyFolder {
tcx: self.interner.tcx,
opaque_ty_id,