@@ -196,7 +196,7 @@ fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGua
196196 hir:: Node :: Crate ( _) => bug ! ( "check_well_formed cannot be applied to the crate root" ) ,
197197 hir:: Node :: Item ( item) => check_item ( tcx, item) ,
198198 hir:: Node :: TraitItem ( ..) => Ok ( ( ) ) ,
199- hir:: Node :: ImplItem ( item ) => check_impl_item ( tcx , item ) ,
199+ hir:: Node :: ImplItem ( .. ) => Ok ( ( ) ) ,
200200 hir:: Node :: ForeignItem ( item) => check_foreign_item ( tcx, item) ,
201201 hir:: Node :: ConstBlock ( _) | hir:: Node :: Expr ( _) | hir:: Node :: OpaqueTy ( _) => Ok ( ( ) ) ,
202202 _ => unreachable ! ( "{node:?}" ) ,
@@ -329,7 +329,7 @@ pub(crate) fn check_trait_item<'tcx>(
329329 // Check that an item definition in a subtrait is shadowing a supertrait item.
330330 lint_item_shadowing_supertrait_item ( tcx, def_id) ;
331331
332- let mut res = check_associated_item ( tcx , def_id ) ;
332+ let mut res = Ok ( ( ) ) ;
333333
334334 if matches ! ( tcx. def_kind( def_id) , DefKind :: AssocFn ) {
335335 for & assoc_ty_def_id in tcx. associated_types_for_impl_traits_in_associated_fn ( def_id) {
@@ -812,13 +812,6 @@ fn lint_item_shadowing_supertrait_item<'tcx>(tcx: TyCtxt<'tcx>, trait_item_def_i
812812 }
813813}
814814
815- fn check_impl_item < ' tcx > (
816- tcx : TyCtxt < ' tcx > ,
817- impl_item : & ' tcx hir:: ImplItem < ' tcx > ,
818- ) -> Result < ( ) , ErrorGuaranteed > {
819- check_associated_item ( tcx, impl_item. owner_id . def_id )
820- }
821-
822815fn check_param_wf ( tcx : TyCtxt < ' _ > , param : & ty:: GenericParamDef ) -> Result < ( ) , ErrorGuaranteed > {
823816 match param. kind {
824817 // We currently only check wf of const params here.
@@ -945,7 +938,10 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
945938}
946939
947940#[ instrument( level = "debug" , skip( tcx) ) ]
948- fn check_associated_item ( tcx : TyCtxt < ' _ > , item_id : LocalDefId ) -> Result < ( ) , ErrorGuaranteed > {
941+ pub ( crate ) fn check_associated_item (
942+ tcx : TyCtxt < ' _ > ,
943+ item_id : LocalDefId ,
944+ ) -> Result < ( ) , ErrorGuaranteed > {
949945 let loc = Some ( WellFormedLoc :: Ty ( item_id) ) ;
950946 enter_wf_checking_ctxt ( tcx, item_id, |wfcx| {
951947 let item = tcx. associated_item ( item_id) ;
0 commit comments