]> git.lizzy.rs Git - rust.git/commitdiff
Check for Const param in collect
authorvarkor <github@varkor.com>
Sat, 16 Feb 2019 13:03:30 +0000 (13:03 +0000)
committervarkor <github@varkor.com>
Sat, 16 Feb 2019 13:03:30 +0000 (13:03 +0000)
src/librustc_typeck/collect.rs

index db508a5772689152d27338bf7dc422b0d2fbb88b..8f382243bb5a3f0f44da94d50b56b256c54b7654 100644 (file)
@@ -1320,10 +1320,10 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> {
         },
 
         Node::GenericParam(param) => match &param.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),
         },