@@ -22,12 +22,13 @@ use super::glb::Glb;
22
22
use super :: lub:: Lub ;
23
23
use super :: type_relating:: TypeRelating ;
24
24
use super :: StructurallyRelateAliases ;
25
+ use super :: { RelateResult , TypeRelation } ;
26
+ use crate :: infer:: relate;
25
27
use crate :: infer:: { DefineOpaqueTypes , InferCtxt , TypeTrace } ;
26
28
use crate :: traits:: { Obligation , PredicateObligations } ;
27
29
use rustc_middle:: bug;
28
30
use rustc_middle:: infer:: unify_key:: EffectVarValue ;
29
31
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
30
- use rustc_middle:: ty:: relate:: { RelateResult , TypeRelation } ;
31
32
use rustc_middle:: ty:: { self , InferConst , Ty , TyCtxt , TypeVisitableExt , Upcast } ;
32
33
use rustc_middle:: ty:: { IntType , UintType } ;
33
34
use rustc_span:: Span ;
@@ -123,7 +124,7 @@ impl<'tcx> InferCtxt<'tcx> {
123
124
( _, ty:: Alias ( ..) ) | ( ty:: Alias ( ..) , _) if self . next_trait_solver ( ) => {
124
125
match relation. structurally_relate_aliases ( ) {
125
126
StructurallyRelateAliases :: Yes => {
126
- ty :: relate:: structurally_relate_tys ( relation, a, b)
127
+ relate:: structurally_relate_tys ( relation, a, b)
127
128
}
128
129
StructurallyRelateAliases :: No => {
129
130
relation. register_type_relate_obligation ( a, b) ;
@@ -134,7 +135,7 @@ impl<'tcx> InferCtxt<'tcx> {
134
135
135
136
// All other cases of inference are errors
136
137
( & ty:: Infer ( _) , _) | ( _, & ty:: Infer ( _) ) => {
137
- Err ( TypeError :: Sorts ( ty :: relate :: expected_found ( a, b) ) )
138
+ Err ( TypeError :: Sorts ( ExpectedFound :: new ( true , a, b) ) )
138
139
}
139
140
140
141
// During coherence, opaque types should be treated as *possibly*
@@ -146,7 +147,7 @@ impl<'tcx> InferCtxt<'tcx> {
146
147
Ok ( a)
147
148
}
148
149
149
- _ => ty :: relate:: structurally_relate_tys ( relation, a, b) ,
150
+ _ => relate:: structurally_relate_tys ( relation, a, b) ,
150
151
}
151
152
}
152
153
@@ -236,11 +237,11 @@ impl<'tcx> InferCtxt<'tcx> {
236
237
Ok ( b)
237
238
}
238
239
StructurallyRelateAliases :: Yes => {
239
- ty :: relate:: structurally_relate_consts ( relation, a, b)
240
+ relate:: structurally_relate_consts ( relation, a, b)
240
241
}
241
242
}
242
243
}
243
- _ => ty :: relate:: structurally_relate_consts ( relation, a, b) ,
244
+ _ => relate:: structurally_relate_consts ( relation, a, b) ,
244
245
}
245
246
}
246
247
@@ -326,7 +327,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
326
327
}
327
328
}
328
329
329
- pub trait ObligationEmittingRelation < ' tcx > : TypeRelation < ' tcx > {
330
+ pub trait ObligationEmittingRelation < ' tcx > : TypeRelation < TyCtxt < ' tcx > > {
330
331
fn span ( & self ) -> Span ;
331
332
332
333
fn param_env ( & self ) -> ty:: ParamEnv < ' tcx > ;
0 commit comments