Rollup merge of #125597 - compiler-errors:early-binder, r=jackh726

Uplift `EarlyBinder` into `rustc_type_ir`

We also need to give `EarlyBinder` a `'tcx` param, so that we can carry the `Interner` in the `EarlyBinder` too. This is necessary because otherwise we have an unconstrained `I: Interner` parameter in many of the `EarlyBinder`'s inherent impls.

I also generally think that this is desirable to have, in case we later want to track some state in the `EarlyBinder`.

r? lcnr
This commit is contained in:
Guillaume Gomez 2024-05-27 13:10:36 +02:00 committed by GitHub
commit a9c125f864
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 786 additions and 705 deletions

View file

@ -2097,7 +2097,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
let args = translate_args(selcx.infcx, param_env, impl_def_id, args, assoc_ty.defining_node);
let ty = tcx.type_of(assoc_ty.item.def_id);
let is_const = matches!(tcx.def_kind(assoc_ty.item.def_id), DefKind::AssocConst);
let term: ty::EarlyBinder<ty::Term<'tcx>> = if is_const {
let term: ty::EarlyBinder<'tcx, ty::Term<'tcx>> = if is_const {
let did = assoc_ty.item.def_id;
let identity_args = crate::traits::GenericArgs::identity_for_item(tcx, did);
let uv = ty::UnevaluatedConst::new(did, identity_args);