change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
This commit is contained in:
parent
be130b57d4
commit
f29a334c90
59 changed files with 108 additions and 127 deletions
|
@ -89,7 +89,7 @@ pub(super) fn check_min_specialization(tcx: TyCtxt<'_>, impl_def_id: LocalDefId)
|
|||
}
|
||||
|
||||
fn parent_specialization_node(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId) -> Option<Node> {
|
||||
let trait_ref = tcx.bound_impl_trait_ref(impl1_def_id.into())?;
|
||||
let trait_ref = tcx.impl_trait_ref(impl1_def_id)?;
|
||||
let trait_def = tcx.trait_def(trait_ref.skip_binder().def_id);
|
||||
|
||||
let impl2_node = trait_def.ancestors(tcx, impl1_def_id.to_def_id()).ok()?.nth(1)?;
|
||||
|
@ -207,7 +207,7 @@ fn unconstrained_parent_impl_substs<'tcx>(
|
|||
let impl_generic_predicates = tcx.predicates_of(impl_def_id);
|
||||
let mut unconstrained_parameters = FxHashSet::default();
|
||||
let mut constrained_params = FxHashSet::default();
|
||||
let impl_trait_ref = tcx.bound_impl_trait_ref(impl_def_id).map(ty::EarlyBinder::subst_identity);
|
||||
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id).map(ty::EarlyBinder::subst_identity);
|
||||
|
||||
// Unfortunately the functions in `constrained_generic_parameters` don't do
|
||||
// what we want here. We want only a list of constrained parameters while
|
||||
|
@ -370,7 +370,7 @@ fn check_predicates<'tcx>(
|
|||
});
|
||||
|
||||
// Include the well-formed predicates of the type parameters of the impl.
|
||||
for arg in tcx.bound_impl_trait_ref(impl1_def_id.into()).unwrap().subst_identity().substs {
|
||||
for arg in tcx.impl_trait_ref(impl1_def_id).unwrap().subst_identity().substs {
|
||||
let infcx = &tcx.infer_ctxt().build();
|
||||
let obligations = wf::obligations(
|
||||
infcx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue