From 037fdb8213da90f3fe26f78b1e415b86f59b0185 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Wed, 30 Jan 2019 07:30:39 +0100 Subject: [PATCH] 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`. --- src/librustc_typeck/collect.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index ade84faae8dbd..120467cbd13a0 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 ¶m.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 => {