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