Skip to content

Commit 33c4769

Browse files
authored
Rollup merge of rust-lang#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`.
2 parents 776ac40 + 037fdb8 commit 33c4769

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_typeck/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1303,12 +1303,12 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> {
13031303
}
13041304
},
13051305

1306-
Node::GenericParam(param) => match param.kind {
1306+
Node::GenericParam(param) => match &param.kind {
13071307
hir::GenericParamKind::Type {
13081308
default: Some(ref ty),
13091309
..
13101310
} => icx.to_ty(ty),
1311-
_ => bug!("unexpected non-type NodeGenericParam"),
1311+
x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
13121312
},
13131313

13141314
x => {

0 commit comments

Comments
 (0)