@@ -58,6 +58,7 @@ use crate::traits::{
58
58
PredicateObligation ,
59
59
} ;
60
60
61
+ use crate :: infer:: relate:: { self , RelateResult , TypeRelation } ;
61
62
use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
62
63
use rustc_errors:: {
63
64
codes:: * , pluralize, struct_span_code_err, Applicability , Diag , DiagCtxt , DiagStyledString ,
@@ -73,7 +74,6 @@ use rustc_middle::bug;
73
74
use rustc_middle:: dep_graph:: DepContext ;
74
75
use rustc_middle:: ty:: error:: TypeErrorToStringExt ;
75
76
use rustc_middle:: ty:: print:: { with_forced_trimmed_paths, PrintError , PrintTraitRefExt as _} ;
76
- use rustc_middle:: ty:: relate:: { self , RelateResult , TypeRelation } ;
77
77
use rustc_middle:: ty:: Upcast ;
78
78
use rustc_middle:: ty:: {
79
79
self , error:: TypeError , IsSuggestable , List , Region , Ty , TyCtxt , TypeFoldable ,
@@ -2687,15 +2687,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
2687
2687
/// with the other type. A TyVar inference type is compatible with any type, and an IntVar or
2688
2688
/// FloatVar inference type are compatible with themselves or their concrete types (Int and
2689
2689
/// 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 {
2691
2691
let ( a, b) = self . resolve_vars_if_possible ( ( a, b) ) ;
2692
2692
SameTypeModuloInfer ( self ) . relate ( a, b) . is_ok ( )
2693
2693
}
2694
2694
}
2695
2695
2696
2696
struct SameTypeModuloInfer < ' a , ' tcx > ( & ' a InferCtxt < ' tcx > ) ;
2697
2697
2698
- impl < ' tcx > TypeRelation < ' tcx > for SameTypeModuloInfer < ' _ , ' tcx > {
2698
+ impl < ' tcx > TypeRelation < TyCtxt < ' tcx > > for SameTypeModuloInfer < ' _ , ' tcx > {
2699
2699
fn tcx ( & self ) -> TyCtxt < ' tcx > {
2700
2700
self . 0 . tcx
2701
2701
}
@@ -2704,7 +2704,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
2704
2704
"SameTypeModuloInfer"
2705
2705
}
2706
2706
2707
- fn relate_with_variance < T : relate:: Relate < ' tcx > > (
2707
+ fn relate_with_variance < T : relate:: Relate < TyCtxt < ' tcx > > > (
2708
2708
& mut self ,
2709
2709
_variance : ty:: Variance ,
2710
2710
_info : ty:: VarianceDiagInfo < TyCtxt < ' tcx > > ,
@@ -2755,7 +2755,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
2755
2755
b : ty:: Binder < ' tcx , T > ,
2756
2756
) -> relate:: RelateResult < ' tcx , ty:: Binder < ' tcx , T > >
2757
2757
where
2758
- T : relate:: Relate < ' tcx > ,
2758
+ T : relate:: Relate < TyCtxt < ' tcx > > ,
2759
2759
{
2760
2760
Ok ( a. rebind ( self . relate ( a. skip_binder ( ) , b. skip_binder ( ) ) ?) )
2761
2761
}
0 commit comments