-impl<'a, 'v> Visitor<'v> for EntryContext<'a> {
- fn visit_item(&mut self, item: &Item) {
- self.depth += 1;
- find_item(item, self);
- self.depth -= 1;
+impl<'a, 'tcx> Visitor<'tcx> for EntryContext<'a, 'tcx> {
+ fn visit_item(&mut self, item: &'tcx Item) {
+ let def_id = self.map.local_def_id(item.id);
+ let def_key = self.map.def_key(def_id);
+ let at_root = def_key.parent == Some(CRATE_DEF_INDEX);
+ find_item(item, self, at_root);