Skip to content

Commit

Permalink
Rollup merge of rust-lang#57984 - phansch:improve_check_ty_error, r=z…
Browse files Browse the repository at this point in the history
…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 authored Jan 30, 2019
2 parents 776ac40 + 037fdb8 commit 33c4769
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 33c4769

Please sign in to comment.