@@ -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) {
@@ -808,13 +808,6 @@ fn lint_item_shadowing_supertrait_item<'tcx>(tcx: TyCtxt<'tcx>, trait_item_def_i
808
808
}
809
809
}
810
810
811
- fn check_impl_item < ' tcx > (
812
- tcx : TyCtxt < ' tcx > ,
813
- impl_item : & ' tcx hir:: ImplItem < ' tcx > ,
814
- ) -> Result < ( ) , ErrorGuaranteed > {
815
- check_associated_item ( tcx, impl_item. owner_id . def_id )
816
- }
817
-
818
811
fn check_param_wf ( tcx : TyCtxt < ' _ > , param : & ty:: GenericParamDef ) -> Result < ( ) , ErrorGuaranteed > {
819
812
match param. kind {
820
813
// We currently only check wf of const params here.
@@ -941,7 +934,10 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
941
934
}
942
935
943
936
#[ instrument( level = "debug" , skip( tcx) ) ]
944
- fn check_associated_item ( tcx : TyCtxt < ' _ > , item_id : LocalDefId ) -> Result < ( ) , ErrorGuaranteed > {
937
+ pub ( crate ) fn check_associated_item (
938
+ tcx : TyCtxt < ' _ > ,
939
+ item_id : LocalDefId ,
940
+ ) -> Result < ( ) , ErrorGuaranteed > {
945
941
let loc = Some ( WellFormedLoc :: Ty ( item_id) ) ;
946
942
enter_wf_checking_ctxt ( tcx, item_id, |wfcx| {
947
943
let item = tcx. associated_item ( item_id) ;
0 commit comments