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`.
This commit is contained in:
Philipp Hansch 2019-01-30 07:30:39 +01:00
parent d3d0bf0e9f
commit 037fdb8213
No known key found for this signature in database
GPG Key ID: B6FA06A6E0E2665B
1 changed files with 2 additions and 2 deletions

View File

@ -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 => {