@@ -558,8 +558,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
558
558
559
559
if !self . span . filter_generated ( sub_span, item. span ) {
560
560
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
+ } ;
561
566
self . dumper . dump_def ( item. vis == ast:: Visibility :: Public , Def {
562
- kind : DefKind :: Struct ,
567
+ kind,
563
568
id : :: id_from_node_id ( item. id , & self . save_ctxt ) ,
564
569
span,
565
570
name,
@@ -1216,7 +1221,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
1216
1221
self . process_static_or_const_item ( item, typ, expr) ,
1217
1222
Const ( ref typ, ref expr) =>
1218
1223
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
+ }
1220
1227
Enum ( ref def, ref ty_params) => self . process_enum ( item, def, ty_params) ,
1221
1228
Impl ( ..,
1222
1229
ref ty_params,
0 commit comments