1
Fork 0

Make super combine into fns

This commit is contained in:
Michael Goulet 2024-10-10 05:40:56 -04:00
parent a4cd2202ef
commit 8715bfbf0e
5 changed files with 208 additions and 217 deletions

View file

@ -18,7 +18,7 @@
//! [lattices]: https://en.wikipedia.org/wiki/Lattice_(order)
use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::combine::InferCtxtCombineExt;
use rustc_middle::ty::relate::combine::{super_combine_consts, super_combine_tys};
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc_middle::ty::{self, Ty, TyCtxt, TyVar, TypeVisitableExt};
use rustc_span::Span;
@ -149,7 +149,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for LatticeOp<'_, 'tcx> {
(
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }),
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }),
) if a_def_id == b_def_id => infcx.super_combine_tys(self, a, b),
) if a_def_id == b_def_id => super_combine_tys(infcx, self, a, b),
(&ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }), _)
| (_, &ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }))
@ -164,7 +164,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for LatticeOp<'_, 'tcx> {
Ok(a)
}
_ => infcx.super_combine_tys(self, a, b),
_ => super_combine_tys(infcx, self, a, b),
}
}
@ -192,7 +192,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for LatticeOp<'_, 'tcx> {
a: ty::Const<'tcx>,
b: ty::Const<'tcx>,
) -> RelateResult<'tcx, ty::Const<'tcx>> {
self.infcx.super_combine_consts(self, a, b)
super_combine_consts(self.infcx, self, a, b)
}
fn binders<T>(

View file

@ -1,5 +1,5 @@
use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::combine::InferCtxtCombineExt;
use rustc_middle::ty::relate::combine::{super_combine_consts, super_combine_tys};
use rustc_middle::ty::relate::{
Relate, RelateResult, TypeRelation, relate_args_invariantly, relate_args_with_variances,
};
@ -186,7 +186,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, 'tcx> {
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }),
&ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }),
) if a_def_id == b_def_id => {
infcx.super_combine_tys(self, a, b)?;
super_combine_tys(infcx, self, a, b)?;
}
(&ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }), _)
@ -202,7 +202,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, 'tcx> {
}
_ => {
infcx.super_combine_tys(self, a, b)?;
super_combine_tys(infcx, self, a, b)?;
}
}
@ -257,7 +257,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, 'tcx> {
a: ty::Const<'tcx>,
b: ty::Const<'tcx>,
) -> RelateResult<'tcx, ty::Const<'tcx>> {
self.infcx.super_combine_consts(self, a, b)
super_combine_consts(self.infcx, self, a, b)
}
fn binders<T>(