about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2019-01-30 07:30:39 +0100
committerPhilipp Hansch <dev@phansch.net>2019-01-30 19:17:06 +0100
commit037fdb8213da90f3fe26f78b1e415b86f59b0185 (patch)
treee25cee88a82b1dd75fb8f21483ca4cac0b3b50f0
parentd3d0bf0e9f4d748b95ed143cc636d159bfcb4a6f (diff)
downloadrust-037fdb8213da90f3fe26f78b1e415b86f59b0185.tar.gz
rust-037fdb8213da90f3fe26f78b1e415b86f59b0185.zip
Improve bug message in check_ty
This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
-rw-r--r--src/librustc_typeck/collect.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index ade84faae8d..120467cbd13 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -1303,12 +1303,12 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> {
             }
         },
 
-        Node::GenericParam(param) => match param.kind {
+        Node::GenericParam(param) => match &param.kind {
             hir::GenericParamKind::Type {
                 default: Some(ref ty),
                 ..
             } => icx.to_ty(ty),
-            _ => bug!("unexpected non-type NodeGenericParam"),
+            x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
         },
 
         x => {