@@ -196,7 +196,7 @@ fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGua
196
196
hir:: Node :: Crate ( _) => bug ! ( "check_well_formed cannot be applied to the crate root" ) ,
197
197
hir:: Node :: Item ( item) => check_item ( tcx, item) ,
198
198
hir:: Node :: TraitItem ( ..) => Ok ( ( ) ) ,
199
- hir:: Node :: ImplItem ( item ) => check_impl_item ( tcx , item ) ,
199
+ hir:: Node :: ImplItem ( .. ) => Ok ( ( ) ) ,
200
200
hir:: Node :: ForeignItem ( item) => check_foreign_item ( tcx, item) ,
201
201
hir:: Node :: ConstBlock ( _) | hir:: Node :: Expr ( _) | hir:: Node :: OpaqueTy ( _) => Ok ( ( ) ) ,
202
202
_ => unreachable ! ( "{node:?}" ) ,
@@ -329,7 +329,7 @@ pub(crate) fn check_trait_item<'tcx>(
329
329
// Check that an item definition in a subtrait is shadowing a supertrait item.
330
330
lint_item_shadowing_supertrait_item ( tcx, def_id) ;
331
331
332
- let mut res = check_associated_item ( tcx , def_id ) ;
332
+ let mut res = Ok ( ( ) ) ;
333
333
334
334
if matches ! ( tcx. def_kind( def_id) , DefKind :: AssocFn ) {
335
335
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
812
812
}
813
813
}
814
814
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
-
822
815
fn check_param_wf ( tcx : TyCtxt < ' _ > , param : & ty:: GenericParamDef ) -> Result < ( ) , ErrorGuaranteed > {
823
816
match param. kind {
824
817
// We currently only check wf of const params here.
@@ -945,7 +938,10 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
945
938
}
946
939
947
940
#[ 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 > {
949
945
let loc = Some ( WellFormedLoc :: Ty ( item_id) ) ;
950
946
enter_wf_checking_ctxt ( tcx, item_id, |wfcx| {
951
947
let item = tcx. associated_item ( item_id) ;
0 commit comments