@@ -84,7 +84,7 @@ use astconv::AstConv;
84
84
use dep_graph:: DepNode ;
85
85
use fmt_macros:: { Parser , Piece , Position } ;
86
86
use hir:: def:: { Def , CtorKind } ;
87
- use hir:: def_id:: { DefId , LOCAL_CRATE } ;
87
+ use hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
88
88
use rustc:: infer:: { self , InferCtxt , InferOk , RegionVariableOrigin , TypeTrace } ;
89
89
use rustc:: infer:: type_variable:: { self , TypeVariableOrigin } ;
90
90
use rustc:: ty:: subst:: { Kind , Subst , Substs } ;
@@ -541,19 +541,21 @@ pub fn check_item_types<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> CompileResult
541
541
}
542
542
543
543
pub fn check_item_bodies < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> CompileResult {
544
- return tcx. sess . track_errors ( || {
545
- tcx. dep_graph . with_task ( DepNode :: TypeckBodiesKrate , tcx, ( ) , check_item_bodies_task) ;
546
- } ) ;
544
+ ty:: queries:: typeck_item_bodies:: get ( tcx, DUMMY_SP , LOCAL_CRATE )
545
+ }
547
546
548
- fn check_item_bodies_task < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , ( ) : ( ) ) {
547
+ fn typeck_item_bodies < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , crate_num : CrateNum ) -> CompileResult {
548
+ debug_assert ! ( crate_num == LOCAL_CRATE ) ;
549
+ tcx. sess . track_errors ( || {
549
550
tcx. visit_all_bodies_in_krate ( |body_owner_def_id, _body_id| {
550
551
tcx. item_tables ( body_owner_def_id) ;
551
552
} ) ;
552
- }
553
+ } )
553
554
}
554
555
555
556
pub fn provide ( providers : & mut Providers ) {
556
557
* providers = Providers {
558
+ typeck_item_bodies,
557
559
typeck_tables,
558
560
closure_type,
559
561
closure_kind,
0 commit comments