]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/eval_order_dependence.rs
find_by_hir_id -> find
[rust.git] / clippy_lints / src / eval_order_dependence.rs
index a62bb3cda9b6e893043071e4362946b3f16a5530..2db3a2bc00b7c6efeeeddb06ed7af813d56efbdb 100644 (file)
@@ -63,7 +63,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                 if let ExprKind::Path(ref qpath) = lhs.node {
                     if let QPath::Resolved(_, ref path) = *qpath {
                         if path.segments.len() == 1 {
-                            if let def::Def::Local(var) = cx.tables.qpath_def(qpath, lhs.hir_id) {
+                            if let def::Res::Local(var) = cx.tables.qpath_res(qpath, lhs.hir_id) {
                                 let mut visitor = ReadVisitor {
                                     cx,
                                     var,
@@ -92,7 +92,7 @@ fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
     }
 }
 
-struct DivergenceVisitor<'a, 'tcx: 'a> {
+struct DivergenceVisitor<'a, 'tcx> {
     cx: &'a LateContext<'a, 'tcx>,
 }
 
@@ -176,11 +176,11 @@ fn check_for_unsequenced_reads(vis: &mut ReadVisitor<'_, '_>) {
     let map = &vis.cx.tcx.hir();
     let mut cur_id = vis.write_expr.hir_id;
     loop {
-        let parent_id = map.get_parent_node_by_hir_id(cur_id);
+        let parent_id = map.get_parent_node(cur_id);
         if parent_id == cur_id {
             break;
         }
-        let parent_node = match map.find_by_hir_id(parent_id) {
+        let parent_node = match map.find(parent_id) {
             Some(parent) => parent,
             None => break,
         };
@@ -272,7 +272,7 @@ fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt) -> St
 }
 
 /// A visitor that looks for reads from a variable.
-struct ReadVisitor<'a, 'tcx: 'a> {
+struct ReadVisitor<'a, 'tcx> {
     cx: &'a LateContext<'a, 'tcx>,
     /// The ID of the variable we're looking for.
     var: HirId,
@@ -295,7 +295,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr) {
                 if_chain! {
                     if let QPath::Resolved(None, ref path) = *qpath;
                     if path.segments.len() == 1;
-                    if let def::Def::Local(local_id) = self.cx.tables.qpath_def(qpath, expr.hir_id);
+                    if let def::Res::Local(local_id) = self.cx.tables.qpath_res(qpath, expr.hir_id);
                     if local_id == self.var;
                     // Check that this is a read, not a write.
                     if !is_in_assignment_position(self.cx, expr);