1
Fork 0

Remove an unnecessary lifetime from RemapLateParam.

This commit is contained in:
Nicholas Nethercote 2025-01-30 13:02:07 +11:00
parent c2e37d32d5
commit ceb09de256
2 changed files with 4 additions and 5 deletions

View file

@ -424,12 +424,12 @@ fn compare_method_predicate_entailment<'tcx>(
Ok(())
}
struct RemapLateParam<'a, 'tcx> {
struct RemapLateParam<'tcx> {
tcx: TyCtxt<'tcx>,
mapping: &'a FxIndexMap<ty::LateParamRegionKind, ty::LateParamRegionKind>,
mapping: FxIndexMap<ty::LateParamRegionKind, ty::LateParamRegionKind>,
}
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateParam<'_, 'tcx> {
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateParam<'tcx> {
fn cx(&self) -> TyCtxt<'tcx> {
self.tcx
}

View file

@ -299,8 +299,7 @@ fn report_mismatched_rpitit_signature<'tcx>(
})
.collect();
let mut return_ty =
trait_m_sig.output().fold_with(&mut super::RemapLateParam { tcx, mapping: &mapping });
let mut return_ty = trait_m_sig.output().fold_with(&mut super::RemapLateParam { tcx, mapping });
if tcx.asyncness(impl_m_def_id).is_async() && tcx.asyncness(trait_m_def_id).is_async() {
let ty::Alias(ty::Projection, future_ty) = return_ty.kind() else {