@@ -58,6 +58,7 @@ use crate::traits::{
5858 PredicateObligation ,
5959} ;
6060
61+ use crate :: infer:: relate:: { self , RelateResult , TypeRelation } ;
6162use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
6263use rustc_errors:: {
6364 codes:: * , pluralize, struct_span_code_err, Applicability , Diag , DiagCtxt , DiagStyledString ,
@@ -73,7 +74,6 @@ use rustc_middle::bug;
7374use rustc_middle:: dep_graph:: DepContext ;
7475use rustc_middle:: ty:: error:: TypeErrorToStringExt ;
7576use rustc_middle:: ty:: print:: { with_forced_trimmed_paths, PrintError , PrintTraitRefExt as _} ;
76- use rustc_middle:: ty:: relate:: { self , RelateResult , TypeRelation } ;
7777use rustc_middle:: ty:: Upcast ;
7878use rustc_middle:: ty:: {
7979 self , error:: TypeError , IsSuggestable , List , Region , Ty , TyCtxt , TypeFoldable ,
@@ -2687,15 +2687,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
26872687 /// with the other type. A TyVar inference type is compatible with any type, and an IntVar or
26882688 /// FloatVar inference type are compatible with themselves or their concrete types (Int and
26892689 /// Float types, respectively). When comparing two ADTs, these rules apply recursively.
2690- pub fn same_type_modulo_infer < T : relate:: Relate < ' tcx > > ( & self , a : T , b : T ) -> bool {
2690+ pub fn same_type_modulo_infer < T : relate:: Relate < TyCtxt < ' tcx > > > ( & self , a : T , b : T ) -> bool {
26912691 let ( a, b) = self . resolve_vars_if_possible ( ( a, b) ) ;
26922692 SameTypeModuloInfer ( self ) . relate ( a, b) . is_ok ( )
26932693 }
26942694}
26952695
26962696struct SameTypeModuloInfer < ' a , ' tcx > ( & ' a InferCtxt < ' tcx > ) ;
26972697
2698- impl < ' tcx > TypeRelation < ' tcx > for SameTypeModuloInfer < ' _ , ' tcx > {
2698+ impl < ' tcx > TypeRelation < TyCtxt < ' tcx > > for SameTypeModuloInfer < ' _ , ' tcx > {
26992699 fn tcx ( & self ) -> TyCtxt < ' tcx > {
27002700 self . 0 . tcx
27012701 }
@@ -2704,7 +2704,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
27042704 "SameTypeModuloInfer"
27052705 }
27062706
2707- fn relate_with_variance < T : relate:: Relate < ' tcx > > (
2707+ fn relate_with_variance < T : relate:: Relate < TyCtxt < ' tcx > > > (
27082708 & mut self ,
27092709 _variance : ty:: Variance ,
27102710 _info : ty:: VarianceDiagInfo < TyCtxt < ' tcx > > ,
@@ -2755,7 +2755,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
27552755 b : ty:: Binder < ' tcx , T > ,
27562756 ) -> relate:: RelateResult < ' tcx , ty:: Binder < ' tcx , T > >
27572757 where
2758- T : relate:: Relate < ' tcx > ,
2758+ T : relate:: Relate < TyCtxt < ' tcx > > ,
27592759 {
27602760 Ok ( a. rebind ( self . relate ( a. skip_binder ( ) , b. skip_binder ( ) ) ?) )
27612761 }
0 commit comments