From 849eb4b2bdd5a63494e5d7901b3257ce3e138d4b Mon Sep 17 00:00:00 2001 From: Ding Xiang Fei Date: Mon, 24 Jan 2022 23:27:19 +0800 Subject: [PATCH] use the new visitor api --- compiler/rustc_passes/src/region.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_passes/src/region.rs b/compiler/rustc_passes/src/region.rs index 678b0c6e5e222..de26585e9014e 100644 --- a/compiler/rustc_passes/src/region.rs +++ b/compiler/rustc_passes/src/region.rs @@ -278,10 +278,6 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet } } impl<'a, 'b> Visitor<'a> for LocalAccessResolutionVisitor<'b> { - type Map = intravisit::ErasedMap<'a>; - fn nested_visit_map(&mut self) -> NestedVisitorMap { - NestedVisitorMap::None - } fn visit_expr(&mut self, expr: &'a Expr<'a>) { match expr.kind { hir::ExprKind::AddrOf(..) @@ -290,7 +286,8 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet | hir::ExprKind::Index(..) | hir::ExprKind::Path(..) => self.probe(expr), - // We do not probe into other function bodies or blocks. + // We do not probe into other function bodies or blocks, + // neither `if`s and `match`es because they will be covered in deeper visits hir::ExprKind::If(..) | hir::ExprKind::Match(..) | hir::ExprKind::Block(..)