diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-05-30 12:57:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-30 12:57:40 +0200 |
| commit | e7fdba84e2ae5b0fd566859b6ec42c55e7a5c783 (patch) | |
| tree | c8863473512087a953e5444a6e8037e1d2257ff6 /compiler/rustc_ty_utils/src | |
| parent | 65833eddb7eec9c5cd672de4773215442b41fdf7 (diff) | |
| parent | 08d149ca85b1afe0c554310bd203bd9d1a3f8bb2 (diff) | |
| download | rust-e7fdba84e2ae5b0fd566859b6ec42c55e7a5c783.tar.gz rust-e7fdba84e2ae5b0fd566859b6ec42c55e7a5c783.zip | |
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`
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/assoc.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/consts.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/layout.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/needs_drop.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs index 0925b3956de..57b4183d336 100644 --- a/compiler/rustc_ty_utils/src/assoc.rs +++ b/compiler/rustc_ty_utils/src/assoc.rs @@ -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), ))); diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index bb723c9997a..ce77df0df5d 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -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) { diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 0e5b23ca423..7015778e24b 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -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)); diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs index 075fde6ddb6..9d593dc5e04 100644 --- a/compiler/rustc_ty_utils/src/needs_drop.rs +++ b/compiler/rustc_ty_utils/src/needs_drop.rs @@ -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), diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 190a7765ff1..12ad8b0842f 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -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 |
