Skip to content
Permalink
Browse files

Rollup merge of rust-lang#57984 - phansch:improve_check_ty_error, r=z…

…ackmdavis

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`.
  • Loading branch information...
Centril committed Jan 31, 2019
2 parents 9b3aedf + 037fdb8 commit dfc8ff549fdcfadd67f7cd74b572e7ba7f17296f
Showing with 2 additions and 2 deletions.
  1. +2 −2 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 => {

0 comments on commit dfc8ff5

Please sign in to comment.
You can’t perform that action at this time.