@@ -8,7 +8,7 @@ use rustc_attr as attr;
8
8
use rustc_errors:: { ErrorGuaranteed , MultiSpan } ;
9
9
use rustc_hir as hir;
10
10
use rustc_hir:: def:: { CtorKind , DefKind } ;
11
- use rustc_hir:: def_id:: LocalModDefId ;
11
+ use rustc_hir:: def_id:: { DefId , LocalDefId } ;
12
12
use rustc_hir:: Node ;
13
13
use rustc_infer:: infer:: { RegionVariableOrigin , TyCtxtInferExt } ;
14
14
use rustc_infer:: traits:: { Obligation , TraitEngineExt as _} ;
@@ -440,7 +440,7 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
440
440
}
441
441
}
442
442
443
- fn check_item_type ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
443
+ pub ( crate ) fn check_item_type ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
444
444
let _indenter = indenter ( ) ;
445
445
match tcx. def_kind ( def_id) {
446
446
DefKind :: Static ( ..) => {
@@ -458,11 +458,7 @@ fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
458
458
DefKind :: Fn => { } // entirely within check_item_body
459
459
DefKind :: Impl { of_trait } => {
460
460
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 ( ) ) ;
466
462
check_on_unimplemented ( tcx, def_id) ;
467
463
}
468
464
}
@@ -1304,16 +1300,6 @@ pub(super) fn check_type_params_are_used<'tcx>(
1304
1300
}
1305
1301
}
1306
1302
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
-
1317
1303
fn async_opaque_type_cycle_error ( tcx : TyCtxt < ' _ > , span : Span ) -> ErrorGuaranteed {
1318
1304
struct_span_err ! ( tcx. dcx( ) , span, E0733 , "recursion in an `async fn` requires boxing" )
1319
1305
. span_label ( span, "recursive `async fn`" )
0 commit comments