@@ -1009,8 +1009,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
1009
1009
res = res. and ( check_associated_item ( tcx, def_id) ) ;
1010
1010
let assoc_item = tcx. associated_item ( def_id) ;
1011
1011
match assoc_item. container {
1012
- ty:: AssocItemContainer :: Impl => { }
1013
- ty:: AssocItemContainer :: Trait => {
1012
+ ty:: AssocContainer :: InherentImpl | ty :: AssocContainer :: TraitImpl ( _ ) => { }
1013
+ ty:: AssocContainer :: Trait => {
1014
1014
res = res. and ( check_trait_item ( tcx, def_id) ) ;
1015
1015
}
1016
1016
}
@@ -1026,8 +1026,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
1026
1026
res = res. and ( check_associated_item ( tcx, def_id) ) ;
1027
1027
let assoc_item = tcx. associated_item ( def_id) ;
1028
1028
match assoc_item. container {
1029
- ty:: AssocItemContainer :: Impl => { }
1030
- ty:: AssocItemContainer :: Trait => {
1029
+ ty:: AssocContainer :: InherentImpl | ty :: AssocContainer :: TraitImpl ( _ ) => { }
1030
+ ty:: AssocContainer :: Trait => {
1031
1031
res = res. and ( check_trait_item ( tcx, def_id) ) ;
1032
1032
}
1033
1033
}
@@ -1043,8 +1043,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
1043
1043
1044
1044
let assoc_item = tcx. associated_item ( def_id) ;
1045
1045
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 => {
1048
1048
tcx. ensure_ok ( ) . explicit_item_bounds ( def_id) ;
1049
1049
tcx. ensure_ok ( ) . explicit_item_self_bounds ( def_id) ;
1050
1050
if tcx. is_conditionally_const ( def_id) {
@@ -1177,12 +1177,9 @@ fn check_impl_items_against_trait<'tcx>(
1177
1177
1178
1178
for & impl_item in impl_item_refs {
1179
1179
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 ,
1186
1183
} ;
1187
1184
1188
1185
let res = tcx. ensure_ok ( ) . compare_impl_item ( impl_item. expect_local ( ) ) ;
0 commit comments