1
Fork 0

Replace EarlyBinder(x) with EarlyBinder::new(x)

This commit is contained in:
Kyle Matsuda 2023-05-26 11:19:35 -06:00
parent 39c03fb652
commit 03534ac8b7
46 changed files with 63 additions and 59 deletions

View file

@ -301,7 +301,7 @@ fn associated_type_for_impl_trait_in_trait(
trait_assoc_ty.impl_defaultness(tcx.impl_defaultness(fn_def_id));
// Copy type_of of the opaque.
trait_assoc_ty.type_of(ty::EarlyBinder(tcx.mk_opaque(
trait_assoc_ty.type_of(ty::EarlyBinder::new(tcx.mk_opaque(
opaque_ty_def_id.to_def_id(),
InternalSubsts::identity_for_item(tcx, opaque_ty_def_id),
)));

View file

@ -419,7 +419,7 @@ pub fn thir_abstract_const(
let root_span = body.exprs[body_id].span;
Ok(Some(ty::EarlyBinder(recurse_build(tcx, body, body_id, root_span)?)))
Ok(Some(ty::EarlyBinder::new(recurse_build(tcx, body, body_id, root_span)?)))
}
pub fn provide(providers: &mut Providers) {

View file

@ -610,7 +610,7 @@ fn generator_layout<'tcx>(
) -> Result<Layout<'tcx>, LayoutError<'tcx>> {
use SavedLocalEligibility::*;
let tcx = cx.tcx;
let subst_field = |ty: Ty<'tcx>| EarlyBinder(ty).subst(tcx, substs);
let subst_field = |ty: Ty<'tcx>| EarlyBinder::new(ty).subst(tcx, substs);
let Some(info) = tcx.generator_layout(def_id) else {
return Err(LayoutError::Unknown(ty));

View file

@ -210,7 +210,7 @@ fn drop_tys_helper<'tcx>(
match subty.kind() {
ty::Adt(adt_id, subst) => {
for subty in tcx.adt_drop_tys(adt_id.did())? {
vec.push(EarlyBinder(subty).subst(tcx, subst));
vec.push(EarlyBinder::new(subty).subst(tcx, subst));
}
}
_ => vec.push(subty),

View file

@ -508,7 +508,7 @@ fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option<EarlyBinder<Ty<'
if self_ty_matches {
debug!("issue33140_self_ty - MATCHES!");
Some(EarlyBinder(self_ty))
Some(EarlyBinder::new(self_ty))
} else {
debug!("issue33140_self_ty - non-matching self type");
None