@@ -134,15 +134,8 @@ impl<'tcx> InferCtxt<'tcx> {
134134 }
135135
136136 ( _, ty:: Alias ( ..) ) | ( ty:: Alias ( ..) , _) if self . next_trait_solver ( ) => {
137- match relation. structurally_relate_aliases ( ) {
138- StructurallyRelateAliases :: Yes => {
139- relate:: structurally_relate_tys ( relation, a, b)
140- }
141- StructurallyRelateAliases :: No => {
142- relation. register_alias_relate_predicate ( a, b) ;
143- Ok ( a)
144- }
145- }
137+ relation. register_alias_relate_predicate ( a, b) ;
138+ Ok ( a)
146139 }
147140
148141 // All other cases of inference are errors
@@ -215,12 +208,12 @@ impl<'tcx> InferCtxt<'tcx> {
215208 }
216209
217210 ( ty:: ConstKind :: Infer ( InferConst :: Var ( vid) ) , _) => {
218- self . instantiate_const_var ( relation, true , vid, b) ?;
211+ self . instantiate_const_var ( relation, StructurallyRelateAliases :: No , true , vid, b) ?;
219212 Ok ( b)
220213 }
221214
222215 ( _, ty:: ConstKind :: Infer ( InferConst :: Var ( vid) ) ) => {
223- self . instantiate_const_var ( relation, false , vid, a) ?;
216+ self . instantiate_const_var ( relation, StructurallyRelateAliases :: No , false , vid, a) ?;
224217 Ok ( a)
225218 }
226219
@@ -235,24 +228,17 @@ impl<'tcx> InferCtxt<'tcx> {
235228 ( ty:: ConstKind :: Unevaluated ( ..) , _) | ( _, ty:: ConstKind :: Unevaluated ( ..) )
236229 if self . tcx . features ( ) . generic_const_exprs || self . next_trait_solver ( ) =>
237230 {
238- match relation. structurally_relate_aliases ( ) {
239- StructurallyRelateAliases :: No => {
240- relation. register_predicates ( [ if self . next_trait_solver ( ) {
241- ty:: PredicateKind :: AliasRelate (
242- a. into ( ) ,
243- b. into ( ) ,
244- ty:: AliasRelationDirection :: Equate ,
245- )
246- } else {
247- ty:: PredicateKind :: ConstEquate ( a, b)
248- } ] ) ;
249-
250- Ok ( b)
251- }
252- StructurallyRelateAliases :: Yes => {
253- relate:: structurally_relate_consts ( relation, a, b)
254- }
255- }
231+ relation. register_predicates ( [ if self . next_trait_solver ( ) {
232+ ty:: PredicateKind :: AliasRelate (
233+ a. into ( ) ,
234+ b. into ( ) ,
235+ ty:: AliasRelationDirection :: Equate ,
236+ )
237+ } else {
238+ ty:: PredicateKind :: ConstEquate ( a, b)
239+ } ] ) ;
240+
241+ Ok ( b)
256242 }
257243 _ => relate:: structurally_relate_consts ( relation, a, b) ,
258244 }
@@ -282,19 +268,16 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
282268 self . infcx . tcx
283269 }
284270
285- pub fn equate < ' a > (
286- & ' a mut self ,
287- structurally_relate_aliases : StructurallyRelateAliases ,
288- ) -> TypeRelating < ' a , ' infcx , ' tcx > {
289- TypeRelating :: new ( self , structurally_relate_aliases, ty:: Invariant )
271+ pub fn equate < ' a > ( & ' a mut self ) -> TypeRelating < ' a , ' infcx , ' tcx > {
272+ TypeRelating :: new ( self , ty:: Invariant )
290273 }
291274
292275 pub fn sub < ' a > ( & ' a mut self ) -> TypeRelating < ' a , ' infcx , ' tcx > {
293- TypeRelating :: new ( self , StructurallyRelateAliases :: No , ty:: Covariant )
276+ TypeRelating :: new ( self , ty:: Covariant )
294277 }
295278
296279 pub fn sup < ' a > ( & ' a mut self ) -> TypeRelating < ' a , ' infcx , ' tcx > {
297- TypeRelating :: new ( self , StructurallyRelateAliases :: No , ty:: Contravariant )
280+ TypeRelating :: new ( self , ty:: Contravariant )
298281 }
299282
300283 pub fn lub < ' a > ( & ' a mut self ) -> Lub < ' a , ' infcx , ' tcx > {
0 commit comments