22
22
//! [TypeRelation::a_is_expected], so when dealing with contravariance
23
23
//! this should be correctly updated.
24
24
25
- use super :: equate:: Equate ;
26
25
use super :: glb:: Glb ;
27
26
use super :: lub:: Lub ;
28
- use super :: sub :: Sub ;
27
+ use super :: type_relating :: TypeRelating ;
29
28
use crate :: infer:: { DefineOpaqueTypes , InferCtxt , TypeTrace } ;
30
29
use crate :: traits:: { Obligation , PredicateObligations } ;
31
30
use rustc_middle:: infer:: canonical:: OriginalQueryValues ;
@@ -34,7 +33,6 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
34
33
use rustc_middle:: ty:: relate:: { RelateResult , TypeRelation } ;
35
34
use rustc_middle:: ty:: { self , InferConst , ToPredicate , Ty , TyCtxt , TypeVisitableExt } ;
36
35
use rustc_middle:: ty:: { IntType , UintType } ;
37
- use rustc_middle:: ty:: { RelationDirection , TyVar } ;
38
36
use rustc_span:: Span ;
39
37
40
38
#[ derive( Clone ) ]
@@ -304,12 +302,12 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
304
302
self . infcx . tcx
305
303
}
306
304
307
- pub fn equate < ' a > ( & ' a mut self , a_is_expected : bool ) -> Equate < ' a , ' infcx , ' tcx > {
308
- Equate :: new ( self , a_is_expected)
305
+ pub fn equate < ' a > ( & ' a mut self , a_is_expected : bool ) -> TypeRelating < ' a , ' infcx , ' tcx > {
306
+ TypeRelating :: new ( self , a_is_expected, ty :: RelationDirection :: Equate )
309
307
}
310
308
311
- pub fn sub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Sub < ' a , ' infcx , ' tcx > {
312
- Sub :: new ( self , a_is_expected)
309
+ pub fn sub < ' a > ( & ' a mut self , a_is_expected : bool ) -> TypeRelating < ' a , ' infcx , ' tcx > {
310
+ TypeRelating :: new ( self , a_is_expected, ty :: RelationDirection :: Subtype )
313
311
}
314
312
315
313
pub fn lub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Lub < ' a , ' infcx , ' tcx > {
0 commit comments