1
Fork 0

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

@ -449,7 +449,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
tcx: TyCtxt<'tcx>,
impl_m_def_id: LocalDefId,
) -> Result<&'tcx DefIdMap<ty::EarlyBinder<Ty<'tcx>>>, ErrorGuaranteed> {
) -> Result<&'tcx DefIdMap<ty::EarlyBinder<'tcx, Ty<'tcx>>>, ErrorGuaranteed> {
let impl_m = tcx.opt_associated_item(impl_m_def_id.to_def_id()).unwrap();
let trait_m = tcx.opt_associated_item(impl_m.trait_item_def_id.unwrap()).unwrap();
let impl_trait_ref =