Skip to content

Commit

Permalink
Update collect to use the standard visit routine, rather than rolling
Browse files Browse the repository at this point in the history
its own.
  • Loading branch information
nikomatsakis committed Feb 5, 2016
1 parent 35b6e2b commit 8a29040
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc_typeck/collect.rs
Expand Up @@ -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);
}

///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 8a29040

Please sign in to comment.