Skip to content

Commit 8a29040

Browse files
committed
Update collect to use the standard visit routine, rather than rolling
its own.
1 parent 35b6e2b commit 8a29040

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/librustc_typeck/collect.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ use rustc_front::print::pprust;
9999

100100
pub fn collect_item_types(tcx: &ty::ctxt) {
101101
let ccx = &CrateCtxt { tcx: tcx, stack: RefCell::new(Vec::new()) };
102-
103102
let mut visitor = CollectItemTypesVisitor{ ccx: ccx };
104-
ccx.tcx.map.krate().visit_all_items(&mut visitor);
103+
ccx.tcx.visit_all_items_in_krate(DepNode::CollectItem, &mut visitor);
105104
}
106105

107106
///////////////////////////////////////////////////////////////////////////
@@ -146,9 +145,6 @@ struct CollectItemTypesVisitor<'a, 'tcx: 'a> {
146145

147146
impl<'a, 'tcx, 'v> intravisit::Visitor<'v> for CollectItemTypesVisitor<'a, 'tcx> {
148147
fn visit_item(&mut self, item: &hir::Item) {
149-
let tcx = self.ccx.tcx;
150-
let item_def_id = tcx.map.local_def_id(item.id);
151-
let _task = tcx.dep_graph.in_task(DepNode::CollectItem(item_def_id));
152148
convert_item(self.ccx, item);
153149
}
154150
}

0 commit comments

Comments
 (0)