about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2018-09-29 08:04:34 +0200
committerPhilipp Hansch <dev@phansch.net>2018-09-29 21:59:21 +0200
commitd654e3c69b127f274c6ef146bc27901086a1cd28 (patch)
tree4076e2513ece4b01f6ec4df82ad80e304dca205b
parent6622172734a6c456ea85e17b765ad1dbc0e42907 (diff)
downloadrust-d654e3c69b127f274c6ef146bc27901086a1cd28.tar.gz
rust-d654e3c69b127f274c6ef146bc27901086a1cd28.zip
Improve bug! message for impossible case in Relate
Hitting this branch in Clippy and I think it makes sense to print
both values here in case other people hit this branch, too.
-rw-r--r--src/librustc/ty/relate.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc/ty/relate.rs b/src/librustc/ty/relate.rs
index 98042e18d32..547f7cecc4e 100644
--- a/src/librustc/ty/relate.rs
+++ b/src/librustc/ty/relate.rs
@@ -702,7 +702,12 @@ impl<'tcx> Relate<'tcx> for Kind<'tcx> {
             (UnpackedKind::Type(a_ty), UnpackedKind::Type(b_ty)) => {
                 Ok(relation.relate(&a_ty, &b_ty)?.into())
             }
-            (UnpackedKind::Lifetime(_), _) | (UnpackedKind::Type(_), _) => bug!()
+            (UnpackedKind::Lifetime(unpacked), x) => {
+                bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
+            }
+            (UnpackedKind::Type(unpacked), x) => {
+                bug!("impossible case reached: can't relate: {:?} with {:?}", unpacked, x)
+            }
         }
     }
 }