Skip to content

Commit 2a1b6c5

Browse files
committed
Check for Const param in collect
1 parent 18ce997 commit 2a1b6c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_typeck/collect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,10 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> {
13201320
},
13211321

13221322
Node::GenericParam(param) => match &param.kind {
1323-
hir::GenericParamKind::Type {
1324-
default: Some(ref ty),
1325-
..
1326-
} => icx.to_ty(ty),
1323+
hir::GenericParamKind::Type { default: Some(ref ty), .. } |
1324+
hir::GenericParamKind::Const { ref ty, .. } => {
1325+
icx.to_ty(ty)
1326+
}
13271327
x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
13281328
},
13291329

0 commit comments

Comments
 (0)