@@ -558,8 +558,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
558558
559559 if !self . span . filter_generated ( sub_span, item. span ) {
560560 let span = self . span_from_span ( sub_span. expect ( "No span found for struct" ) ) ;
561+ let kind = match item. node {
562+ ast:: ItemKind :: Struct ( _, _) => DefKind :: Struct ,
563+ ast:: ItemKind :: Union ( _, _) => DefKind :: Union ,
564+ _ => unreachable ! ( ) ,
565+ } ;
561566 self . dumper . dump_def ( item. vis == ast:: Visibility :: Public , Def {
562- kind : DefKind :: Struct ,
567+ kind,
563568 id : :: id_from_node_id ( item. id , & self . save_ctxt ) ,
564569 span,
565570 name,
@@ -1216,7 +1221,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
12161221 self . process_static_or_const_item ( item, typ, expr) ,
12171222 Const ( ref typ, ref expr) =>
12181223 self . process_static_or_const_item ( item, & typ, & expr) ,
1219- Struct ( ref def, ref ty_params) => self . process_struct ( item, def, ty_params) ,
1224+ Struct ( ref def, ref ty_params) | Union ( ref def, ref ty_params) => {
1225+ self . process_struct ( item, def, ty_params)
1226+ }
12201227 Enum ( ref def, ref ty_params) => self . process_enum ( item, def, ty_params) ,
12211228 Impl ( ..,
12221229 ref ty_params,
0 commit comments