Skip to content

Commit 849eb4b

Browse files
use the new visitor api
1 parent 7cad314 commit 849eb4b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_passes/src/region.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,6 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet
278278
}
279279
}
280280
impl<'a, 'b> Visitor<'a> for LocalAccessResolutionVisitor<'b> {
281-
type Map = intravisit::ErasedMap<'a>;
282-
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
283-
NestedVisitorMap::None
284-
}
285281
fn visit_expr(&mut self, expr: &'a Expr<'a>) {
286282
match expr.kind {
287283
hir::ExprKind::AddrOf(..)
@@ -290,7 +286,8 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet
290286
| hir::ExprKind::Index(..)
291287
| hir::ExprKind::Path(..) => self.probe(expr),
292288

293-
// We do not probe into other function bodies or blocks.
289+
// We do not probe into other function bodies or blocks,
290+
// neither `if`s and `match`es because they will be covered in deeper visits
294291
hir::ExprKind::If(..)
295292
| hir::ExprKind::Match(..)
296293
| hir::ExprKind::Block(..)

0 commit comments

Comments
 (0)