From: varkor Date: Sat, 16 Feb 2019 13:03:30 +0000 (+0000) Subject: Check for Const param in collect X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2a1b6c52d34aa021a3930fdea954b3228fba0f71;p=rust.git Check for Const param in collect --- diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index db508a57726..8f382243bb5 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1320,10 +1320,10 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> { }, Node::GenericParam(param) => match ¶m.kind { - hir::GenericParamKind::Type { - default: Some(ref ty), - .. - } => icx.to_ty(ty), + hir::GenericParamKind::Type { default: Some(ref ty), .. } | + hir::GenericParamKind::Const { ref ty, .. } => { + icx.to_ty(ty) + } x => bug!("unexpected non-type Node::GenericParam: {:?}", x), },