1
- // ignore-tidy-filelength
2
-
3
1
/*!
4
2
5
3
# typeck: check phase
@@ -82,6 +80,7 @@ mod pat;
82
80
mod place_op;
83
81
mod regionck;
84
82
mod upvar;
83
+ mod util;
85
84
mod wfcheck;
86
85
pub mod writeback;
87
86
@@ -97,7 +96,7 @@ use rustc_errors::ErrorReported;
97
96
use rustc_errors:: { pluralize, struct_span_err, Applicability , DiagnosticBuilder , DiagnosticId } ;
98
97
use rustc_hir as hir;
99
98
use rustc_hir:: def:: { CtorOf , DefKind , Res } ;
100
- use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , LOCAL_CRATE } ;
99
+ use rustc_hir:: def_id:: { DefId , DefIdMap , LocalDefId , LOCAL_CRATE } ;
101
100
use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
102
101
use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
103
102
use rustc_hir:: lang_items:: LangItem ;
@@ -738,31 +737,12 @@ pub fn check_wf_new(tcx: TyCtxt<'_>) {
738
737
tcx. hir ( ) . krate ( ) . par_visit_all_item_likes ( & visit) ;
739
738
}
740
739
741
- fn check_mod_item_types ( tcx : TyCtxt < ' _ > , module_def_id : LocalDefId ) {
742
- tcx. hir ( ) . visit_item_likes_in_module ( module_def_id, & mut CheckItemTypesVisitor { tcx } ) ;
743
- }
744
-
745
- fn typeck_item_bodies ( tcx : TyCtxt < ' _ > , crate_num : CrateNum ) {
746
- debug_assert ! ( crate_num == LOCAL_CRATE ) ;
747
- tcx. par_body_owners ( |body_owner_def_id| {
748
- tcx. ensure ( ) . typeck ( body_owner_def_id) ;
749
- } ) ;
750
- }
751
-
752
- fn check_item_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
753
- wfcheck:: check_item_well_formed ( tcx, def_id) ;
754
- }
755
-
756
- fn check_trait_item_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
757
- wfcheck:: check_trait_item ( tcx, def_id) ;
758
- }
759
-
760
- fn check_impl_item_well_formed ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
761
- wfcheck:: check_impl_item ( tcx, def_id) ;
762
- }
763
-
764
740
pub fn provide ( providers : & mut Providers ) {
765
741
method:: provide ( providers) ;
742
+ use util:: {
743
+ check_impl_item_well_formed, check_item_well_formed, check_mod_item_types,
744
+ check_trait_item_well_formed, typeck_item_bodies,
745
+ } ;
766
746
* providers = Providers {
767
747
typeck_item_bodies,
768
748
typeck_const_arg,
0 commit comments