@@ -11,8 +11,8 @@ use rustc_macros::extension;
1111use rustc_middle:: span_bug;
1212use rustc_middle:: traits:: { ObligationCause , ObligationCauseCode } ;
1313use 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 ,
1616} ;
1717use tracing:: { debug, instrument} ;
1818
@@ -450,14 +450,13 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
450450 } ;
451451
452452 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 => {
456456 self . normalize_inherent_projection ( uv. into ( ) )
457457 }
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" ,
461460 ) ,
462461 } ,
463462 DefKind :: Const | DefKind :: AnonConst => self . normalize_free_alias ( uv. into ( ) ) ,
0 commit comments