@@ -121,12 +121,12 @@ impl<'tcx> InferCtxt<'tcx> {
121121 | (
122122 ty:: Infer ( ty:: TyVar ( _) | ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) ,
123123 ty:: Alias ( AliasKind :: Projection , _) ,
124- ) if self . tcx . trait_solver_next ( ) => {
124+ ) if self . use_new_solver => {
125125 bug ! ( )
126126 }
127127
128128 ( _, ty:: Alias ( AliasKind :: Projection , _) ) | ( ty:: Alias ( AliasKind :: Projection , _) , _)
129- if self . tcx . trait_solver_next ( ) =>
129+ if self . use_new_solver =>
130130 {
131131 relation. register_type_relate_obligation ( a, b) ;
132132 Ok ( a)
@@ -242,15 +242,37 @@ impl<'tcx> InferCtxt<'tcx> {
242242 // FIXME(#59490): Need to remove the leak check to accommodate
243243 // escaping bound variables here.
244244 if !a. has_escaping_bound_vars ( ) && !b. has_escaping_bound_vars ( ) {
245- relation. register_const_equate_obligation ( a, b) ;
245+ let ( a, b) = if relation. a_is_expected ( ) { ( a, b) } else { ( b, a) } ;
246+
247+ // FIXME(deferred_projection_equality): What do here...
248+ relation. register_predicates ( [ ty:: Binder :: dummy ( if self . use_new_solver {
249+ ty:: PredicateKind :: AliasRelate (
250+ a. into ( ) ,
251+ b. into ( ) ,
252+ ty:: AliasRelationDirection :: Equate ,
253+ )
254+ } else {
255+ ty:: PredicateKind :: ConstEquate ( a, b)
256+ } ) ] ) ;
246257 }
247258 return Ok ( b) ;
248259 }
249260 ( _, ty:: ConstKind :: Unevaluated ( ..) ) if self . tcx . lazy_normalization ( ) => {
250261 // FIXME(#59490): Need to remove the leak check to accommodate
251262 // escaping bound variables here.
252263 if !a. has_escaping_bound_vars ( ) && !b. has_escaping_bound_vars ( ) {
253- relation. register_const_equate_obligation ( a, b) ;
264+ let ( a, b) = if relation. a_is_expected ( ) { ( a, b) } else { ( b, a) } ;
265+
266+ // FIXME(deferred_projection_equality): What do here...
267+ relation. register_predicates ( [ ty:: Binder :: dummy ( if self . use_new_solver {
268+ ty:: PredicateKind :: AliasRelate (
269+ a. into ( ) ,
270+ b. into ( ) ,
271+ ty:: AliasRelationDirection :: Equate ,
272+ )
273+ } else {
274+ ty:: PredicateKind :: ConstEquate ( a, b)
275+ } ) ] ) ;
254276 }
255277 return Ok ( a) ;
256278 }
@@ -835,19 +857,6 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
835857 /// be used if control over the obligation causes is required.
836858 fn register_predicates ( & mut self , obligations : impl IntoIterator < Item : ToPredicate < ' tcx > > ) ;
837859
838- /// Register an obligation that both constants must be equal to each other.
839- ///
840- /// If they aren't equal then the relation doesn't hold.
841- fn register_const_equate_obligation ( & mut self , a : ty:: Const < ' tcx > , b : ty:: Const < ' tcx > ) {
842- let ( a, b) = if self . a_is_expected ( ) { ( a, b) } else { ( b, a) } ;
843-
844- self . register_predicates ( [ ty:: Binder :: dummy ( if self . tcx ( ) . trait_solver_next ( ) {
845- ty:: PredicateKind :: AliasRelate ( a. into ( ) , b. into ( ) , ty:: AliasRelationDirection :: Equate )
846- } else {
847- ty:: PredicateKind :: ConstEquate ( a, b)
848- } ) ] ) ;
849- }
850-
851860 /// Register an obligation that both types must be related to each other according to
852861 /// the [`ty::AliasRelationDirection`] given by [`ObligationEmittingRelation::alias_relate_direction`]
853862 fn register_type_relate_obligation ( & mut self , a : Ty < ' tcx > , b : Ty < ' tcx > ) {
0 commit comments