@@ -223,7 +223,10 @@ impl<TF: TypeFamily> AntiUnifier<'_, TF> {
223
223
TyData :: Alias ( AliasTy :: Projection ( proj2) ) ,
224
224
) => self . aggregate_projection_tys ( proj1, proj2) ,
225
225
226
- ( TyData :: Alias ( _) , TyData :: Alias ( _) ) => todo ! ( ) ,
226
+ (
227
+ TyData :: Alias ( AliasTy :: ImplTrait ( impl_trait1) ) ,
228
+ TyData :: Alias ( AliasTy :: ImplTrait ( impl_trait2) ) ,
229
+ ) => self . aggregate_impl_trait_tys ( impl_trait1, impl_trait2) ,
227
230
228
231
( TyData :: Placeholder ( placeholder1) , TyData :: Placeholder ( placeholder2) ) => {
229
232
self . aggregate_placeholder_tys ( placeholder1, placeholder2)
@@ -298,6 +301,31 @@ impl<TF: TypeFamily> AntiUnifier<'_, TF> {
298
301
. unwrap_or_else ( || self . new_variable ( ) )
299
302
}
300
303
304
+ fn aggregate_impl_trait_tys (
305
+ & mut self ,
306
+ impl_trait1 : & ImplTraitTy < TF > ,
307
+ impl_trait2 : & ImplTraitTy < TF > ,
308
+ ) -> Ty < TF > {
309
+ let ImplTraitTy {
310
+ impl_trait_id : name1,
311
+ substitution : substitution1,
312
+ } = impl_trait1;
313
+ let ImplTraitTy {
314
+ impl_trait_id : name2,
315
+ substitution : substitution2,
316
+ } = impl_trait2;
317
+
318
+ self . aggregate_name_and_substs ( name1, substitution1, name2, substitution2)
319
+ . map ( |( & impl_trait_id, substitution) | {
320
+ TyData :: Alias ( AliasTy :: ImplTrait ( ImplTraitTy {
321
+ impl_trait_id,
322
+ substitution,
323
+ } ) )
324
+ . intern ( )
325
+ } )
326
+ . unwrap_or_else ( || self . new_variable ( ) )
327
+ }
328
+
301
329
fn aggregate_name_and_substs < N > (
302
330
& mut self ,
303
331
name1 : N ,
0 commit comments