@@ -231,48 +231,48 @@ struct AntiUnifier<'infer, 'intern, I: Interner> {
231231impl < I : Interner > AntiUnifier < ' _ , ' _ , I > {
232232 fn aggregate_tys ( & mut self , ty0 : & Ty < I > , ty1 : & Ty < I > ) -> Ty < I > {
233233 let interner = self . interner ;
234- match ( ty0. data ( interner) , ty1. data ( interner) ) {
234+ match ( ty0. kind ( interner) , ty1. kind ( interner) ) {
235235 // If we see bound things on either side, just drop in a
236236 // fresh variable. This means we will sometimes
237237 // overgeneralize. So for example if we have two
238238 // solutions that are both `(X, X)`, we just produce `(Y,
239239 // Z)` in all cases.
240- ( TyData :: InferenceVar ( _, _) , TyData :: InferenceVar ( _, _) ) => self . new_ty_variable ( ) ,
240+ ( TyKind :: InferenceVar ( _, _) , TyKind :: InferenceVar ( _, _) ) => self . new_ty_variable ( ) ,
241241
242242 // Ugh. Aggregating two types like `for<'a> fn(&'a u32,
243243 // &'a u32)` and `for<'a, 'b> fn(&'a u32, &'b u32)` seems
244244 // kinda hard. Don't try to be smart for now, just plop a
245245 // variable in there and be done with it.
246- ( TyData :: BoundVar ( _) , TyData :: BoundVar ( _) )
247- | ( TyData :: Function ( _) , TyData :: Function ( _) )
248- | ( TyData :: Dyn ( _) , TyData :: Dyn ( _) ) => self . new_ty_variable ( ) ,
246+ ( TyKind :: BoundVar ( _) , TyKind :: BoundVar ( _) )
247+ | ( TyKind :: Function ( _) , TyKind :: Function ( _) )
248+ | ( TyKind :: Dyn ( _) , TyKind :: Dyn ( _) ) => self . new_ty_variable ( ) ,
249249
250- ( TyData :: Apply ( apply1) , TyData :: Apply ( apply2) ) => {
250+ ( TyKind :: Apply ( apply1) , TyKind :: Apply ( apply2) ) => {
251251 self . aggregate_application_tys ( apply1, apply2)
252252 }
253253
254254 (
255- TyData :: Alias ( AliasTy :: Projection ( proj1) ) ,
256- TyData :: Alias ( AliasTy :: Projection ( proj2) ) ,
255+ TyKind :: Alias ( AliasTy :: Projection ( proj1) ) ,
256+ TyKind :: Alias ( AliasTy :: Projection ( proj2) ) ,
257257 ) => self . aggregate_projection_tys ( proj1, proj2) ,
258258
259259 (
260- TyData :: Alias ( AliasTy :: Opaque ( opaque_ty1) ) ,
261- TyData :: Alias ( AliasTy :: Opaque ( opaque_ty2) ) ,
260+ TyKind :: Alias ( AliasTy :: Opaque ( opaque_ty1) ) ,
261+ TyKind :: Alias ( AliasTy :: Opaque ( opaque_ty2) ) ,
262262 ) => self . aggregate_opaque_ty_tys ( opaque_ty1, opaque_ty2) ,
263263
264- ( TyData :: Placeholder ( placeholder1) , TyData :: Placeholder ( placeholder2) ) => {
264+ ( TyKind :: Placeholder ( placeholder1) , TyKind :: Placeholder ( placeholder2) ) => {
265265 self . aggregate_placeholder_tys ( placeholder1, placeholder2)
266266 }
267267
268268 // Mismatched base kinds.
269- ( TyData :: InferenceVar ( _, _) , _)
270- | ( TyData :: BoundVar ( _) , _)
271- | ( TyData :: Dyn ( _) , _)
272- | ( TyData :: Function ( _) , _)
273- | ( TyData :: Apply ( _) , _)
274- | ( TyData :: Alias ( _) , _)
275- | ( TyData :: Placeholder ( _) , _) => self . new_ty_variable ( ) ,
269+ ( TyKind :: InferenceVar ( _, _) , _)
270+ | ( TyKind :: BoundVar ( _) , _)
271+ | ( TyKind :: Dyn ( _) , _)
272+ | ( TyKind :: Function ( _) , _)
273+ | ( TyKind :: Apply ( _) , _)
274+ | ( TyKind :: Alias ( _) , _)
275+ | ( TyKind :: Placeholder ( _) , _) => self . new_ty_variable ( ) ,
276276 }
277277 }
278278
@@ -293,7 +293,7 @@ impl<I: Interner> AntiUnifier<'_, '_, I> {
293293
294294 self . aggregate_name_and_substs ( name1, substitution1, name2, substitution2)
295295 . map ( |( & name, substitution) | {
296- TyData :: Apply ( ApplicationTy { name, substitution } ) . intern ( interner)
296+ TyKind :: Apply ( ApplicationTy { name, substitution } ) . intern ( interner)
297297 } )
298298 . unwrap_or_else ( || self . new_ty_variable ( ) )
299299 }
@@ -307,7 +307,7 @@ impl<I: Interner> AntiUnifier<'_, '_, I> {
307307 if index1 != index2 {
308308 self . new_ty_variable ( )
309309 } else {
310- TyData :: Placeholder ( * index1) . intern ( interner)
310+ TyKind :: Placeholder ( * index1) . intern ( interner)
311311 }
312312 }
313313
@@ -328,7 +328,7 @@ impl<I: Interner> AntiUnifier<'_, '_, I> {
328328
329329 self . aggregate_name_and_substs ( name1, substitution1, name2, substitution2)
330330 . map ( |( & associated_ty_id, substitution) | {
331- TyData :: Alias ( AliasTy :: Projection ( ProjectionTy {
331+ TyKind :: Alias ( AliasTy :: Projection ( ProjectionTy {
332332 associated_ty_id,
333333 substitution,
334334 } ) )
@@ -353,7 +353,7 @@ impl<I: Interner> AntiUnifier<'_, '_, I> {
353353
354354 self . aggregate_name_and_substs ( name1, substitution1, name2, substitution2)
355355 . map ( |( & opaque_ty_id, substitution) | {
356- TyData :: Alias ( AliasTy :: Opaque ( OpaqueTy {
356+ TyKind :: Alias ( AliasTy :: Opaque ( OpaqueTy {
357357 opaque_ty_id,
358358 substitution,
359359 } ) )
0 commit comments