@@ -118,7 +118,6 @@ use syntax::util::lev_distance::find_best_match_for_name;
118
118
use syntax_pos:: { self , BytePos , Span , DUMMY_SP } ;
119
119
120
120
use rustc:: hir:: intravisit:: { self , Visitor , NestedVisitorMap } ;
121
- use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
122
121
use rustc:: hir:: { self , PatKind } ;
123
122
use rustc:: middle:: lang_items;
124
123
use rustc_back:: slice;
@@ -515,7 +514,6 @@ impl<'a, 'gcx, 'tcx> Inherited<'a, 'gcx, 'tcx> {
515
514
}
516
515
517
516
struct CheckItemTypesVisitor < ' a , ' tcx : ' a > { tcx : TyCtxt < ' a , ' tcx , ' tcx > }
518
- struct CheckItemBodiesVisitor < ' a , ' tcx : ' a > { tcx : TyCtxt < ' a , ' tcx , ' tcx > }
519
517
520
518
impl < ' a , ' tcx > Visitor < ' tcx > for CheckItemTypesVisitor < ' a , ' tcx > {
521
519
fn nested_visit_map < ' this > ( & ' this mut self ) -> NestedVisitorMap < ' this , ' tcx > {
@@ -550,43 +548,6 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckItemTypesVisitor<'a, 'tcx> {
550
548
}
551
549
}
552
550
553
- impl < ' a , ' tcx > ItemLikeVisitor < ' tcx > for CheckItemBodiesVisitor < ' a , ' tcx > {
554
- fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
555
- match item. node {
556
- hir:: ItemFn ( ..) => {
557
- self . tcx . item_tables ( self . tcx . hir . local_def_id ( item. id ) ) ;
558
- }
559
- _ => { }
560
- }
561
- }
562
-
563
- fn visit_trait_item ( & mut self , trait_item : & ' tcx hir:: TraitItem ) {
564
- match trait_item. node {
565
- hir:: TraitItemKind :: Const ( _, Some ( _) ) |
566
- hir:: TraitItemKind :: Method ( _, hir:: TraitMethod :: Provided ( _) ) => {
567
- self . tcx . item_tables ( self . tcx . hir . local_def_id ( trait_item. id ) ) ;
568
- }
569
- hir:: TraitItemKind :: Method ( _, hir:: TraitMethod :: Required ( _) ) |
570
- hir:: TraitItemKind :: Const ( _, None ) |
571
- hir:: TraitItemKind :: Type ( ..) => {
572
- // Nothing to do.
573
- }
574
- }
575
- }
576
-
577
- fn visit_impl_item ( & mut self , impl_item : & ' tcx hir:: ImplItem ) {
578
- match impl_item. node {
579
- hir:: ImplItemKind :: Const ( ..) |
580
- hir:: ImplItemKind :: Method ( ..) => {
581
- self . tcx . item_tables ( self . tcx . hir . local_def_id ( impl_item. id ) ) ;
582
- }
583
- hir:: ImplItemKind :: Type ( _) => {
584
- // Nothing to do here.
585
- }
586
- }
587
- }
588
- }
589
-
590
551
pub fn check_wf_new < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> CompileResult {
591
552
tcx. sess . track_errors ( || {
592
553
let mut visit = wfcheck:: CheckTypeWellFormedVisitor :: new ( tcx) ;
@@ -604,8 +565,11 @@ pub fn check_item_types<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> CompileResult
604
565
605
566
pub fn check_item_bodies < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> CompileResult {
606
567
tcx. sess . track_errors ( || {
607
- let mut visit = CheckItemBodiesVisitor { tcx : tcx } ;
608
- tcx. visit_all_item_likes_in_krate ( DepNode :: TypeckTables , & mut visit) ;
568
+ tcx. dep_graph . with_task ( DepNode :: TypeckBodiesKrate , || {
569
+ tcx. visit_all_bodies_in_krate ( |body_owner_def_id, _body_id| {
570
+ tcx. item_tables ( body_owner_def_id) ;
571
+ } ) ;
572
+ } ) ;
609
573
} )
610
574
}
611
575
0 commit comments