about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/middle/borrowck/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs
index aab434371a1..62ea02540e1 100644
--- a/src/librustc/middle/borrowck/mod.rs
+++ b/src/librustc/middle/borrowck/mod.rs
@@ -386,10 +386,11 @@ impl<'tcx> LoanPath<'tcx> {
             (&LpExtend(ref base, a, LpInterior(id)),
              &LpExtend(ref base2, _, LpInterior(id2))) => {
                 if id == id2 {
-                    assert!(self.ty == other.ty);
                     base.common(&**base2).map(|x| {
                         let xd = x.depth();
                         if base.depth() == xd && base2.depth() == xd {
+                            assert_eq!(base.ty, base2.ty);
+                            assert_eq!(self.ty, other.ty);
                             LoanPath {
                                 kind: LpExtend(Rc::new(x), a, LpInterior(id)),
                                 ty: self.ty,
@@ -406,7 +407,7 @@ impl<'tcx> LoanPath<'tcx> {
             (_, &LpExtend(ref other, _, LpDeref(_))) => self.common(&**other),
             (&LpVar(id), &LpVar(id2)) => {
                 if id == id2 {
-                    assert!(self.ty == other.ty);
+                    assert_eq!(self.ty, other.ty);
                     Some(LoanPath { kind: LpVar(id), ty: self.ty })
                 } else {
                     None
@@ -414,7 +415,7 @@ impl<'tcx> LoanPath<'tcx> {
             }
             (&LpUpvar(id), &LpUpvar(id2)) => {
                 if id == id2 {
-                    assert!(self.ty == other.ty);
+                    assert_eq!(self.ty, other.ty);
                     Some(LoanPath { kind: LpUpvar(id), ty: self.ty })
                 } else {
                     None