1
Fork 0

map_bound_ref -> rebind

This commit is contained in:
Jack Huey 2020-10-16 14:04:11 -04:00
parent 11d62aa284
commit eba10270c6
21 changed files with 77 additions and 78 deletions

View file

@ -634,9 +634,9 @@ fn prune_cache_value_obligations<'a, 'tcx>(
// indirect obligations (e.g., we project to `?0`,
// but we have `T: Foo<X = ?1>` and `?1: Bar<X =
// ?0>`).
ty::PredicateAtom::Projection(data) => infcx
.unresolved_type_vars(&bound_predicate.map_bound_ref(|_| data.ty))
.is_some(),
ty::PredicateAtom::Projection(data) => {
infcx.unresolved_type_vars(&bound_predicate.rebind(data.ty)).is_some()
}
// We are only interested in `T: Foo<X = U>` predicates, whre
// `U` references one of `unresolved_type_vars`. =)
@ -910,7 +910,7 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>(
debug!(?predicate);
let bound_predicate = predicate.bound_atom(infcx.tcx);
if let ty::PredicateAtom::Projection(data) = predicate.skip_binders() {
let data = bound_predicate.map_bound_ref(|_| data);
let data = bound_predicate.rebind(data);
let same_def_id = data.projection_def_id() == obligation.predicate.item_def_id;
let is_match = same_def_id