summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-31 02:10:47 +0100
committerGitHub <noreply@github.com>2019-01-31 02:10:47 +0100
commitdfc8ff549fdcfadd67f7cd74b572e7ba7f17296f (patch)
tree934ed3d02ba5225604a16ec26fed69a35fa560b9
parent9b3aedf5b0bd74e50987a59052695f04a3fb78bb (diff)
parent037fdb8213da90f3fe26f78b1e415b86f59b0185 (diff)
downloadrust-dfc8ff549fdcfadd67f7cd74b572e7ba7f17296f.tar.gz
Rollup merge of #57984 - phansch:improve_check_ty_error, r=zackmdavis
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 => {