@@ -134,15 +134,8 @@ impl<'tcx> InferCtxt<'tcx> {
134
134
}
135
135
136
136
( _, 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)
146
139
}
147
140
148
141
// All other cases of inference are errors
@@ -215,12 +208,12 @@ impl<'tcx> InferCtxt<'tcx> {
215
208
}
216
209
217
210
( 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) ?;
219
212
Ok ( b)
220
213
}
221
214
222
215
( _, 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) ?;
224
217
Ok ( a)
225
218
}
226
219
@@ -235,24 +228,17 @@ impl<'tcx> InferCtxt<'tcx> {
235
228
( ty:: ConstKind :: Unevaluated ( ..) , _) | ( _, ty:: ConstKind :: Unevaluated ( ..) )
236
229
if self . tcx . features ( ) . generic_const_exprs || self . next_trait_solver ( ) =>
237
230
{
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)
256
242
}
257
243
_ => relate:: structurally_relate_consts ( relation, a, b) ,
258
244
}
@@ -282,19 +268,16 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
282
268
self . infcx . tcx
283
269
}
284
270
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 )
290
273
}
291
274
292
275
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 )
294
277
}
295
278
296
279
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 )
298
281
}
299
282
300
283
pub fn lub < ' a > ( & ' a mut self ) -> Lub < ' a , ' infcx , ' tcx > {
0 commit comments