Skip to content

Commit 09ac9fd

Browse files
Rollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov
Fix `-Z hir-stats` always panics. Fix #43232.
2 parents 31916ac + 36ba8ee commit 09ac9fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_passes/hir_stats.rs

+5
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
125125
self.visit_impl_item(nested_impl_item)
126126
}
127127

128+
fn visit_nested_body(&mut self, body_id: hir::BodyId) {
129+
let nested_body = self.krate.unwrap().body(body_id);
130+
self.visit_body(nested_body)
131+
}
132+
128133
fn visit_item(&mut self, i: &'v hir::Item) {
129134
self.record("Item", Id::Node(i.id), i);
130135
hir_visit::walk_item(self, i)

0 commit comments

Comments
 (0)