@@ -54,23 +54,15 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
54
54
& mut self ,
55
55
goal : Goal < ' tcx , NormalizesTo < ' tcx > > ,
56
56
) -> QueryResult < ' tcx > {
57
- let def_id = goal. predicate . def_id ( ) ;
58
- match self . tcx ( ) . def_kind ( def_id) {
59
- DefKind :: AssocTy | DefKind :: AssocConst => {
60
- match self . tcx ( ) . associated_item ( def_id) . container {
61
- ty:: AssocItemContainer :: TraitContainer => {
62
- let candidates = self . assemble_and_evaluate_candidates ( goal) ;
63
- self . merge_candidates ( candidates)
64
- }
65
- ty:: AssocItemContainer :: ImplContainer => {
66
- self . normalize_inherent_associated_type ( goal)
67
- }
68
- }
57
+ match goal. predicate . alias . kind ( self . tcx ( ) ) {
58
+ ty:: AliasTermKind :: ProjectionTy | ty:: AliasTermKind :: ProjectionConst => {
59
+ let candidates = self . assemble_and_evaluate_candidates ( goal) ;
60
+ self . merge_candidates ( candidates)
69
61
}
70
- DefKind :: AnonConst => self . normalize_anon_const ( goal) ,
71
- DefKind :: TyAlias => self . normalize_weak_type ( goal) ,
72
- DefKind :: OpaqueTy => self . normalize_opaque_type ( goal) ,
73
- kind => bug ! ( "unknown DefKind {} in normalizes-to goal: {goal:#?}" , kind . descr ( def_id ) ) ,
62
+ ty :: AliasTermKind :: InherentTy => self . normalize_inherent_associated_type ( goal) ,
63
+ ty :: AliasTermKind :: OpaqueTy => self . normalize_opaque_type ( goal) ,
64
+ ty :: AliasTermKind :: WeakTy => self . normalize_weak_type ( goal) ,
65
+ ty :: AliasTermKind :: UnevaluatedConst => self . normalize_anon_const ( goal ) ,
74
66
}
75
67
}
76
68
0 commit comments