|
1 | 1 | use clippy_utils::diagnostics::{span_lint, span_lint_and_note}; |
2 | 2 | use clippy_utils::{get_parent_expr, path_to_local, path_to_local_id}; |
3 | 3 | use if_chain::if_chain; |
4 | | -use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; |
| 4 | +use rustc_hir::intravisit::{walk_expr, Visitor}; |
5 | 5 | use rustc_hir::{BinOpKind, Block, Expr, ExprKind, Guard, HirId, Local, Node, Stmt, StmtKind}; |
6 | 6 | use rustc_lint::{LateContext, LateLintPass}; |
7 | | -use rustc_middle::hir::map::Map; |
8 | 7 | use rustc_middle::ty; |
9 | 8 | use rustc_session::{declare_lint_pass, declare_tool_lint}; |
10 | 9 |
|
@@ -133,8 +132,6 @@ impl<'a, 'tcx> DivergenceVisitor<'a, 'tcx> { |
133 | 132 | } |
134 | 133 |
|
135 | 134 | impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> { |
136 | | - type Map = Map<'tcx>; |
137 | | - |
138 | 135 | fn visit_expr(&mut self, e: &'tcx Expr<'_>) { |
139 | 136 | match e.kind { |
140 | 137 | ExprKind::Continue(_) | ExprKind::Break(_, _) | ExprKind::Ret(_) => self.report_diverging_sub_expr(e), |
@@ -167,9 +164,6 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> { |
167 | 164 | fn visit_block(&mut self, _: &'tcx Block<'_>) { |
168 | 165 | // don't continue over blocks, LateLintPass already does that |
169 | 166 | } |
170 | | - fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> { |
171 | | - NestedVisitorMap::None |
172 | | - } |
173 | 167 | } |
174 | 168 |
|
175 | 169 | /// Walks up the AST from the given write expression (`vis.write_expr`) looking |
@@ -299,8 +293,6 @@ struct ReadVisitor<'a, 'tcx> { |
299 | 293 | } |
300 | 294 |
|
301 | 295 | impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> { |
302 | | - type Map = Map<'tcx>; |
303 | | - |
304 | 296 | fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { |
305 | 297 | if expr.hir_id == self.last_expr.hir_id { |
306 | 298 | return; |
@@ -343,9 +335,6 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> { |
343 | 335 |
|
344 | 336 | walk_expr(self, expr); |
345 | 337 | } |
346 | | - fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> { |
347 | | - NestedVisitorMap::None |
348 | | - } |
349 | 338 | } |
350 | 339 |
|
351 | 340 | /// Returns `true` if `expr` is the LHS of an assignment, like `expr = ...`. |
|
0 commit comments