Skip to content

Commit

Permalink
Fix -Z hir-stats always panics (fix #43232).
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Aug 12, 2017
1 parent 2fa5340 commit 36ba8ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librustc_passes/hir_stats.rs
Expand Up @@ -125,6 +125,11 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
self.visit_impl_item(nested_impl_item)
}

fn visit_nested_body(&mut self, body_id: hir::BodyId) {
let nested_body = self.krate.unwrap().body(body_id);
self.visit_body(nested_body)
}

fn visit_item(&mut self, i: &'v hir::Item) {
self.record("Item", Id::Node(i.id), i);
hir_visit::walk_item(self, i)
Expand Down

0 comments on commit 36ba8ee

Please sign in to comment.