- kind: match v.node.kind {
- TupleVariantKind(ref variant_args) => {
- hir::TupleVariantKind(variant_args.iter()
- .map(|ref x| lower_variant_arg(_lctx, x))
- .collect())
- }
- StructVariantKind(ref struct_def) => {
- hir::StructVariantKind(lower_struct_def(_lctx, struct_def))
+ kind: {
+ if v.node.def.ctor_id.is_none() {
+ hir::StructVariantKind(lower_struct_def(_lctx, &v.node.def))
+ } else {
+ hir::TupleVariantKind(v.node.def.fields.iter().map(|ref field| {
+ hir::VariantArg { id: field.node.id, ty: lower_ty(_lctx, &field.node.ty) }
+ }).collect())