Fix weird dogfood error

This commit is contained in:
flip1995 2020-11-28 17:03:20 +01:00
parent 7a73a25622
commit c1b991588f
No known key found for this signature in database
GPG Key ID: 2CEFCDB27ED0BE79

View File

@ -104,7 +104,7 @@ struct ClosureUsageCount<'a, 'tcx> {
cx: &'a LateContext<'tcx>,
path: &'tcx hir::Path<'tcx>,
count: usize,
};
}
impl<'a, 'tcx> hir_visit::Visitor<'tcx> for ClosureUsageCount<'a, 'tcx> {
type Map = Map<'tcx>;
@ -124,7 +124,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {
hir_visit::NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
}
};
}
let mut closure_usage_count = ClosureUsageCount { cx, path, count: 0 };
closure_usage_count.visit_block(block);
closure_usage_count.count