self.tcx.type_of(def_id);
}
hir::GenericParamKind::Type { .. } => {}
+ hir::GenericParamKind::Const { .. } => {
+ let def_id = self.tcx.hir().local_def_id(param.id);
+ self.tcx.type_of(def_id);
+ }
}
}
intravisit::walk_generics(self, generics);
i += 1;
Some(ty_param)
}
+ GenericParamKind::Const { .. } => {
+ if param.name.ident().name == keywords::SelfUpper.name() {
+ span_bug!(
+ param.span,
+ "`Self` should not be the name of a regular parameter",
+ );
+ }
+
+ tcx.sess.struct_span_err(
+ param.span,
+ "const generics in any position are currently unsupported",
+ ).emit();
+ tcx.sess.abort_if_errors();
+ bug!();
+ }
_ => None,
}),
);
}) => {
if gen.is_some() {
let hir_id = tcx.hir().node_to_hir_id(node_id);
- return tcx.typeck_tables_of(def_id).node_id_to_type(hir_id);
+ return tcx.typeck_tables_of(def_id).node_type(hir_id);
}
let substs = ty::ClosureSubsts {
},
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),
},