2222//! [TypeRelation::a_is_expected], so when dealing with contravariance
2323//! this should be correctly updated.
2424
25- use super :: equate:: Equate ;
2625use super :: glb:: Glb ;
2726use super :: lub:: Lub ;
28- use super :: sub :: Sub ;
27+ use super :: type_relating :: TypeRelating ;
2928use crate :: infer:: { DefineOpaqueTypes , InferCtxt , TypeTrace } ;
3029use crate :: traits:: { Obligation , PredicateObligations } ;
3130use rustc_middle:: infer:: canonical:: OriginalQueryValues ;
@@ -34,7 +33,6 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
3433use rustc_middle:: ty:: relate:: { RelateResult , TypeRelation } ;
3534use rustc_middle:: ty:: { self , InferConst , ToPredicate , Ty , TyCtxt , TypeVisitableExt } ;
3635use rustc_middle:: ty:: { IntType , UintType } ;
37- use rustc_middle:: ty:: { RelationDirection , TyVar } ;
3836use rustc_span:: Span ;
3937
4038#[ derive( Clone ) ]
@@ -304,12 +302,12 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
304302 self . infcx . tcx
305303 }
306304
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 )
309307 }
310308
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 )
313311 }
314312
315313 pub fn lub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Lub < ' a , ' infcx , ' tcx > {
0 commit comments