self.tables = old_tables;
}
+ fn visit_body(&mut self, body: &'tcx hir::Body) {
+ run_lints!(self, check_body, late_passes, body);
+ hir_visit::walk_body(self, body);
+ run_lints!(self, check_body_post, late_passes, body);
+ }
+
fn visit_item(&mut self, it: &'tcx hir::Item) {
self.with_lint_attrs(&it.attrs, |cx| {
run_lints!(cx, check_item, late_passes, it);
// FIXME: eliminate the duplication with `Visitor`. But this also
// contains a few lint-specific methods with no equivalent in `Visitor`.
pub trait LateLintPass<'a, 'tcx>: LintPass {
+ fn check_body(&mut self, _: &LateContext, _: &'tcx hir::Body) { }
+ fn check_body_post(&mut self, _: &LateContext, _: &'tcx hir::Body) { }
fn check_name(&mut self, _: &LateContext, _: Span, _: ast::Name) { }
fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx hir::Crate) { }
fn check_crate_post(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx hir::Crate) { }