@@ -8,7 +8,7 @@ use rustc_attr as attr;
88use rustc_errors:: { ErrorGuaranteed , MultiSpan } ;
99use rustc_hir as hir;
1010use rustc_hir:: def:: { CtorKind , DefKind } ;
11- use rustc_hir:: def_id:: LocalModDefId ;
11+ use rustc_hir:: def_id:: { DefId , LocalDefId } ;
1212use rustc_hir:: Node ;
1313use rustc_infer:: infer:: { RegionVariableOrigin , TyCtxtInferExt } ;
1414use rustc_infer:: traits:: { Obligation , TraitEngineExt as _} ;
@@ -440,7 +440,7 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
440440 }
441441}
442442
443- fn check_item_type ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
443+ pub ( crate ) fn check_item_type ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
444444 let _indenter = indenter ( ) ;
445445 match tcx. def_kind ( def_id) {
446446 DefKind :: Static ( ..) => {
@@ -458,11 +458,7 @@ fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
458458 DefKind :: Fn => { } // entirely within check_item_body
459459 DefKind :: Impl { of_trait } => {
460460 if of_trait && let Some ( impl_trait_ref) = tcx. impl_trait_ref ( def_id) {
461- check_impl_items_against_trait (
462- tcx,
463- def_id,
464- impl_trait_ref. instantiate_identity ( ) ,
465- ) ;
461+ check_impl_items_against_trait ( tcx, def_id, impl_trait_ref. instantiate_identity ( ) ) ;
466462 check_on_unimplemented ( tcx, def_id) ;
467463 }
468464 }
@@ -1304,16 +1300,6 @@ pub(super) fn check_type_params_are_used<'tcx>(
13041300 }
13051301}
13061302
1307- pub ( super ) fn check_mod_item_types ( tcx : TyCtxt < ' _ > , module_def_id : LocalModDefId ) {
1308- let module = tcx. hir_module_items ( module_def_id) ;
1309- for id in module. items ( ) {
1310- check_item_type ( tcx, id. owner_id . def_id ) ;
1311- }
1312- if module_def_id == LocalModDefId :: CRATE_DEF_ID {
1313- super :: entry:: check_for_entry_fn ( tcx) ;
1314- }
1315- }
1316-
13171303fn async_opaque_type_cycle_error ( tcx : TyCtxt < ' _ > , span : Span ) -> ErrorGuaranteed {
13181304 struct_span_err ! ( tcx. dcx( ) , span, E0733 , "recursion in an `async fn` requires boxing" )
13191305 . span_label ( span, "recursive `async fn`" )
0 commit comments