@@ -1009,8 +1009,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
10091009 res = res. and ( check_associated_item ( tcx, def_id) ) ;
10101010 let assoc_item = tcx. associated_item ( def_id) ;
10111011 match assoc_item. container {
1012- ty:: AssocItemContainer :: Impl => { }
1013- ty:: AssocItemContainer :: Trait => {
1012+ ty:: AssocContainer :: InherentImpl | ty :: AssocContainer :: TraitImpl ( _ ) => { }
1013+ ty:: AssocContainer :: Trait => {
10141014 res = res. and ( check_trait_item ( tcx, def_id) ) ;
10151015 }
10161016 }
@@ -1026,8 +1026,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
10261026 res = res. and ( check_associated_item ( tcx, def_id) ) ;
10271027 let assoc_item = tcx. associated_item ( def_id) ;
10281028 match assoc_item. container {
1029- ty:: AssocItemContainer :: Impl => { }
1030- ty:: AssocItemContainer :: Trait => {
1029+ ty:: AssocContainer :: InherentImpl | ty :: AssocContainer :: TraitImpl ( _ ) => { }
1030+ ty:: AssocContainer :: Trait => {
10311031 res = res. and ( check_trait_item ( tcx, def_id) ) ;
10321032 }
10331033 }
@@ -1043,8 +1043,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
10431043
10441044 let assoc_item = tcx. associated_item ( def_id) ;
10451045 let has_type = match assoc_item. container {
1046- ty:: AssocItemContainer :: Impl => true ,
1047- ty:: AssocItemContainer :: Trait => {
1046+ ty:: AssocContainer :: InherentImpl | ty :: AssocContainer :: TraitImpl ( _ ) => true ,
1047+ ty:: AssocContainer :: Trait => {
10481048 tcx. ensure_ok ( ) . explicit_item_bounds ( def_id) ;
10491049 tcx. ensure_ok ( ) . explicit_item_self_bounds ( def_id) ;
10501050 if tcx. is_conditionally_const ( def_id) {
@@ -1177,12 +1177,9 @@ fn check_impl_items_against_trait<'tcx>(
11771177
11781178 for & impl_item in impl_item_refs {
11791179 let ty_impl_item = tcx. associated_item ( impl_item) ;
1180- let ty_trait_item = if let Some ( trait_item_id) = ty_impl_item. trait_item_def_id {
1181- tcx. associated_item ( trait_item_id)
1182- } else {
1183- // Checked in `associated_item`.
1184- tcx. dcx ( ) . span_delayed_bug ( tcx. def_span ( impl_item) , "missing associated item in trait" ) ;
1185- continue ;
1180+ let ty_trait_item = match ty_impl_item. expect_trait_impl ( ) {
1181+ Ok ( trait_item_id) => tcx. associated_item ( trait_item_id) ,
1182+ Err ( ErrorGuaranteed { .. } ) => continue ,
11861183 } ;
11871184
11881185 let res = tcx. ensure_ok ( ) . compare_impl_item ( impl_item. expect_local ( ) ) ;
0 commit comments