Make EarlyBinder's inner value private; and fix all of the resulting errors
This commit is contained in:
@@ -360,7 +360,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
// consider a "quick reject". This avoids creating more types
|
||||
// and so forth that we need to.
|
||||
let impl_trait_ref = self.tcx().impl_trait_ref(impl_def_id).unwrap();
|
||||
if !drcx.substs_refs_may_unify(obligation_substs, impl_trait_ref.0.substs) {
|
||||
if !drcx
|
||||
.substs_refs_may_unify(obligation_substs, impl_trait_ref.skip_binder().substs)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if self.reject_fn_ptr_impls(
|
||||
|
||||
@@ -527,9 +527,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
substs.extend(trait_predicate.trait_ref.substs.iter());
|
||||
let mut bound_vars: smallvec::SmallVec<[ty::BoundVariableKind; 8]> =
|
||||
smallvec::SmallVec::with_capacity(
|
||||
bound.0.kind().bound_vars().len() + defs.count(),
|
||||
bound.skip_binder().kind().bound_vars().len() + defs.count(),
|
||||
);
|
||||
bound_vars.extend(bound.0.kind().bound_vars().into_iter());
|
||||
bound_vars.extend(bound.skip_binder().kind().bound_vars().into_iter());
|
||||
InternalSubsts::fill_single(&mut substs, defs, &mut |param, _| match param
|
||||
.kind
|
||||
{
|
||||
|
||||
@@ -2149,13 +2149,11 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
|
||||
ty::Adt(def, substs) => {
|
||||
let sized_crit = def.sized_constraint(self.tcx());
|
||||
// (*) binder moved here
|
||||
Where(obligation.predicate.rebind({
|
||||
sized_crit
|
||||
.0
|
||||
.iter()
|
||||
.map(|ty| sized_crit.rebind(*ty).subst(self.tcx(), substs))
|
||||
.collect()
|
||||
}))
|
||||
Where(
|
||||
obligation
|
||||
.predicate
|
||||
.rebind(sized_crit.subst_iter_copied(self.tcx(), substs).collect()),
|
||||
)
|
||||
}
|
||||
|
||||
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => None,
|
||||
|
||||
Reference in New Issue
Block a user