@@ -554,8 +554,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
554554
555555 if !self . span . filter_generated ( sub_span, item. span ) {
556556 let span = self . span_from_span ( sub_span. expect ( "No span found for struct" ) ) ;
557+ let kind = match item. node {
558+ ast:: ItemKind :: Struct ( _, _) => DefKind :: Struct ,
559+ ast:: ItemKind :: Union ( _, _) => DefKind :: Union ,
560+ _ => unreachable ! ( ) ,
561+ } ;
557562 self . dumper . dump_def ( item. vis == ast:: Visibility :: Public , Def {
558- kind : DefKind :: Struct ,
563+ kind,
559564 id : :: id_from_node_id ( item. id , & self . save_ctxt ) ,
560565 span,
561566 name,
@@ -1212,7 +1217,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
12121217 self . process_static_or_const_item ( item, typ, expr) ,
12131218 Const ( ref typ, ref expr) =>
12141219 self . process_static_or_const_item ( item, & typ, & expr) ,
1215- Struct ( ref def, ref ty_params) => self . process_struct ( item, def, ty_params) ,
1220+ Struct ( ref def, ref ty_params) | Union ( ref def, ref ty_params) => {
1221+ self . process_struct ( item, def, ty_params)
1222+ }
12161223 Enum ( ref def, ref ty_params) => self . process_enum ( item, def, ty_params) ,
12171224 Impl ( ..,
12181225 ref ty_params,
0 commit comments