@@ -84,7 +84,7 @@ use astconv::AstConv;
8484use dep_graph:: DepNode ;
8585use fmt_macros:: { Parser , Piece , Position } ;
8686use hir:: def:: { Def , CtorKind } ;
87- use hir:: def_id:: { DefId , LOCAL_CRATE } ;
87+ use hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
8888use rustc:: infer:: { self , InferCtxt , InferOk , RegionVariableOrigin , TypeTrace } ;
8989use rustc:: infer:: type_variable:: { self , TypeVariableOrigin } ;
9090use rustc:: ty:: subst:: { Kind , Subst , Substs } ;
@@ -541,19 +541,21 @@ pub fn check_item_types<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> CompileResult
541541}
542542
543543pub 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+ }
547546
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 ( || {
549550 tcx. visit_all_bodies_in_krate ( |body_owner_def_id, _body_id| {
550551 tcx. item_tables ( body_owner_def_id) ;
551552 } ) ;
552- }
553+ } )
553554}
554555
555556pub fn provide ( providers : & mut Providers ) {
556557 * providers = Providers {
558+ typeck_item_bodies,
557559 typeck_tables,
558560 closure_type,
559561 closure_kind,
0 commit comments