Rollup merge of #112060 - lcnr:early-binder, r=jackh726

`EarlyBinder::new` -> `EarlyBinder::bind`

for consistency with `Binder::bind`. it may make sense to also add `EarlyBinder::dummy` in places where we know that no parameters exist, but I left that out of this PR.

r? `@jackh726` `@kylematsuda`
This commit is contained in:
Nilstrieb 2023-05-30 12:57:40 +02:00 committed by GitHub
commit e7fdba84e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 60 additions and 60 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::new(tcx.mk_opaque(
trait_assoc_ty.type_of(ty::EarlyBinder::bind(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::new(recurse_build(tcx, body, body_id, root_span)?)))
Ok(Some(ty::EarlyBinder::bind(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::new(ty).subst(tcx, substs);
let subst_field = |ty: Ty<'tcx>| EarlyBinder::bind(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::new(subty).subst(tcx, subst));
vec.push(EarlyBinder::bind(subty).subst(tcx, subst));
}
}
_ => vec.push(subty),

View file

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