about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-01-29 16:25:21 -0500
committerNiko Matsakis <niko@alum.mit.edu>2016-02-05 13:19:55 -0500
commit8a29040989eb12a1c9c82e6eee7040be38be3c39 (patch)
treec1020c035bec7d696af14bcb7350d715e06568e6
parent35b6e2b0bbae9167ebc77ee02bd4542d51b199f3 (diff)
Update collect to use the standard visit routine, rather than rolling
its own.
-rw-r--r--src/librustc_typeck/collect.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index db4f8d3a70c..035be02b0c3 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -99,9 +99,8 @@ use rustc_front::print::pprust;
 
 pub fn collect_item_types(tcx: &ty::ctxt) {
     let ccx = &CrateCtxt { tcx: tcx, stack: RefCell::new(Vec::new()) };
-
     let mut visitor = CollectItemTypesVisitor{ ccx: ccx };
-    ccx.tcx.map.krate().visit_all_items(&mut visitor);
+    ccx.tcx.visit_all_items_in_krate(DepNode::CollectItem, &mut visitor);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -146,9 +145,6 @@ struct CollectItemTypesVisitor<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx, 'v> intravisit::Visitor<'v> for CollectItemTypesVisitor<'a, 'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
-        let tcx = self.ccx.tcx;
-        let item_def_id = tcx.map.local_def_id(item.id);
-        let _task = tcx.dep_graph.in_task(DepNode::CollectItem(item_def_id));
         convert_item(self.ccx, item);
     }
 }