diff options
| author | Philipp Hansch <dev@phansch.net> | 2019-01-30 07:30:39 +0100 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2019-01-30 19:17:06 +0100 |
| commit | 037fdb8213da90f3fe26f78b1e415b86f59b0185 (patch) | |
| tree | e25cee88a82b1dd75fb8f21483ca4cac0b3b50f0 | |
| parent | d3d0bf0e9f4d748b95ed143cc636d159bfcb4a6f (diff) | |
| download | rust-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.rs | 4 |
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 ¶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 => { |
