]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/utils/hir.rs
Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Body fixes for rustup
[rust.git] / clippy_lints / src / utils / hir.rs
index 80399825b6d1b309ef2c48d8d3c1311d1919d7e6..643b5249654376998abeef2e2d43c2fd9d9e995e 100644 (file)
@@ -112,7 +112,7 @@ pub fn eq_expr(&self, left: &Expr, right: &Expr) -> bool {
                 !self.ignore_fn && l_name.node == r_name.node && over(l_tys, r_tys, |l, r| self.eq_ty(l, r)) &&
                 self.eq_exprs(l_args, r_args)
             },
-            (&ExprRepeat(ref le, ref ll), &ExprRepeat(ref re, ref rl)) => self.eq_expr(le, re) && self.eq_expr(ll, rl),
+            (&ExprRepeat(ref le, llId), &ExprRepeat(ref re, rlId)) => self.eq_expr(le, re) && self.eq_expr(&self.cx.tcx.map.body(llId).value, &self.cx.tcx.map.body(rlId).value),
             (&ExprRet(ref l), &ExprRet(ref r)) => both(l, r, |l, r| self.eq_expr(l, r)),
             (&ExprPath(ref l), &ExprPath(ref r)) => self.eq_qpath(l, r),
             (&ExprStruct(ref l_path, ref lf, ref lo), &ExprStruct(ref r_path, ref rf, ref ro)) => {
@@ -183,7 +183,7 @@ fn eq_qpath(&self, left: &QPath, right: &QPath) -> bool {
     }
 
     fn eq_path(&self, left: &Path, right: &Path) -> bool {
-        left.global == right.global && over(&left.segments, &right.segments, |l, r| self.eq_path_segment(l, r))
+        left.is_global() == right.is_global() && over(&left.segments, &right.segments, |l, r| self.eq_path_segment(l, r))
     }
 
     fn eq_path_parameters(&self, left: &PathParameters, right: &PathParameters) -> bool {
@@ -211,7 +211,7 @@ fn eq_path_segment(&self, left: &PathSegment, right: &PathSegment) -> bool {
     fn eq_ty(&self, left: &Ty, right: &Ty) -> bool {
         match (&left.node, &right.node) {
             (&TySlice(ref l_vec), &TySlice(ref r_vec)) => self.eq_ty(l_vec, r_vec),
-            (&TyArray(ref lt, ref ll), &TyArray(ref rt, ref rl)) => self.eq_ty(lt, rt) && self.eq_expr(ll, rl),
+            (&TyArray(ref lt, llId), &TyArray(ref rt, rlId)) => self.eq_ty(lt, rt) && self.eq_expr(&self.cx.tcx.map.body(llId).value, &self.cx.tcx.map.body(rlId).value),
             (&TyPtr(ref l_mut), &TyPtr(ref r_mut)) => l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty),
             (&TyRptr(_, ref l_rmut), &TyRptr(_, ref r_rmut)) => {
                 l_rmut.mutbl == r_rmut.mutbl && self.eq_ty(&*l_rmut.ty, &*r_rmut.ty)
@@ -363,7 +363,7 @@ pub fn hash_expr(&mut self, e: &Expr) {
                 let c: fn(_, _, _, _) -> _ = ExprClosure;
                 c.hash(&mut self.s);
                 cap.hash(&mut self.s);
-                self.hash_expr(self.cx.tcx.map.expr(eid));
+                self.hash_expr(&self.cx.tcx.map.body(eid).value);
             },
             ExprField(ref e, ref f) => {
                 let c: fn(_, _) -> _ = ExprField;
@@ -424,11 +424,11 @@ pub fn hash_expr(&mut self, e: &Expr) {
                 self.hash_name(&name.node);
                 self.hash_exprs(args);
             },
-            ExprRepeat(ref e, ref l) => {
+            ExprRepeat(ref e, lId) => {
                 let c: fn(_, _) -> _ = ExprRepeat;
                 c.hash(&mut self.s);
                 self.hash_expr(e);
-                self.hash_expr(l);
+                self.hash_expr(&self.cx.tcx.map.body(lId).value);
             },
             ExprRet(ref e) => {
                 let c: fn(_) -> _ = ExprRet;
@@ -524,7 +524,7 @@ pub fn hash_qpath(&mut self, p: &QPath) {
     }
 
     pub fn hash_path(&mut self, p: &Path) {
-        p.global.hash(&mut self.s);
+        p.is_global().hash(&mut self.s);
         for p in &p.segments {
             self.hash_name(&p.name);
         }