@@ -11,8 +11,8 @@ use rustc_macros::extension;
11
11
use rustc_middle:: span_bug;
12
12
use rustc_middle:: traits:: { ObligationCause , ObligationCauseCode } ;
13
13
use rustc_middle:: ty:: {
14
- self , AliasTerm , Term , Ty , TyCtxt , TypeFoldable , TypeFolder , TypeSuperFoldable , TypeVisitable ,
15
- TypeVisitableExt , TypingMode ,
14
+ self , AliasTerm , AssocItemContainer , Term , Ty , TyCtxt , TypeFoldable , TypeFolder ,
15
+ TypeSuperFoldable , TypeVisitable , TypeVisitableExt , TypingMode ,
16
16
} ;
17
17
use tracing:: { debug, instrument} ;
18
18
@@ -450,14 +450,13 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
450
450
} ;
451
451
452
452
let ct = match tcx. def_kind ( uv. def ) {
453
- DefKind :: AssocConst => match tcx. def_kind ( tcx . parent ( uv. def ) ) {
454
- DefKind :: Trait => self . normalize_trait_projection ( uv. into ( ) ) ,
455
- DefKind :: Impl { of_trait : false } => {
453
+ DefKind :: AssocConst => match tcx. associated_item ( uv. def ) . container {
454
+ AssocItemContainer :: Trait => self . normalize_trait_projection ( uv. into ( ) ) ,
455
+ AssocItemContainer :: InherentImpl => {
456
456
self . normalize_inherent_projection ( uv. into ( ) )
457
457
}
458
- kind => unreachable ! (
459
- "unexpected `DefKind` for const alias' resolution's parent def: {:?}" ,
460
- kind
458
+ AssocItemContainer :: TraitImpl => unreachable ! (
459
+ "unexpected `TraitImpl` container for const alias' resolution's parent def" ,
461
460
) ,
462
461
} ,
463
462
DefKind :: Const | DefKind :: AnonConst => self . normalize_free_alias ( uv. into ( ) ) ,
0 commit comments