]> git.lizzy.rs Git - rust.git/commitdiff
Rustup
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 30 Aug 2017 16:47:28 +0000 (09:47 -0700)
committerLaura Peskin <laura.peskin@gmail.com>
Sun, 24 Sep 2017 19:40:16 +0000 (15:40 -0400)
clippy_lints/src/loops.rs

index a40278982ab4a0c826519da7dafb9e09495c8a9b..bcae2868db27d391b8b924500226cdceb982ddf5 100644 (file)
@@ -1363,15 +1363,15 @@ fn check_for_mutation(cx: &LateContext, body: &Expr, bound: &Expr) -> bool {
         let ExprPath(ref qpath) = bound.node,
         let QPath::Resolved(None, ref path) = *qpath,
     ], {
-        let def = cx.tables.qpath_def(qpath, bound.id);
+        let def = cx.tables.qpath_def(qpath, bound.hir_id);
         match def {
             Def::Local(..) | Def::Upvar(..) => {
                 let def_id = def.def_id();
                 let node_id = cx.tcx.hir.as_local_node_id(def_id).expect("local/upvar are local nodes");
                 let node_str = cx.tcx.hir.get(node_id);
                 if_let_chain! {[ // prob redundant now, remove
-                    let map::Node::NodeLocal(pat) = node_str,
-                    let PatKind::Binding(bind_ann, _, _, _) = pat.node,
+                    let map::Node::NodeLocal(local) = node_str,
+                    let PatKind::Binding(bind_ann, _, _, _) = local.pat.node,
                     let BindingAnnotation::Mutable = bind_ann,
                     
                 ], {