@@ -1206,7 +1206,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
12061206 is_non_exhaustive : variant. is_field_list_non_exhaustive ( ) ,
12071207 } ;
12081208
1209- record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
1209+ record ! ( self . tables. variant_data[ def_id] <- data) ;
1210+ record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ) ;
12101211 self . tables . constness . set ( def_id. index , hir:: Constness :: Const ) ;
12111212 record_array ! ( self . tables. children[ def_id] <- variant. fields. iter( ) . map( |f| {
12121213 assert!( f. did. is_local( ) ) ;
@@ -1234,7 +1235,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
12341235 is_non_exhaustive : variant. is_field_list_non_exhaustive ( ) ,
12351236 } ;
12361237
1237- record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
1238+ record ! ( self . tables. variant_data[ def_id] <- data) ;
1239+ record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ) ;
12381240 self . tables . constness . set ( def_id. index , hir:: Constness :: Const ) ;
12391241 if variant. ctor_kind == CtorKind :: Fn {
12401242 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
@@ -1301,8 +1303,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
13011303 } ;
13021304
13031305 record ! ( self . tables. repr_options[ def_id] <- adt_def. repr( ) ) ;
1306+ record ! ( self . tables. variant_data[ def_id] <- data) ;
1307+ record ! ( self . tables. kind[ def_id] <- EntryKind :: Struct ) ;
13041308 self . tables . constness . set ( def_id. index , hir:: Constness :: Const ) ;
1305- record ! ( self . tables. kind[ def_id] <- EntryKind :: Struct ( self . lazy( data) ) ) ;
13061309 if variant. ctor_kind == CtorKind :: Fn {
13071310 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
13081311 }
@@ -1541,24 +1544,26 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
15411544 . map ( |ctor_hir_id| self . tcx . hir ( ) . local_def_id ( ctor_hir_id) . local_def_index ) ;
15421545
15431546 let variant = adt_def. non_enum_variant ( ) ;
1544- EntryKind :: Struct ( self . lazy ( VariantData {
1547+ record ! ( self . tables . variant_data [ def_id ] <- VariantData {
15451548 ctor_kind: variant. ctor_kind,
15461549 discr: variant. discr,
15471550 ctor,
15481551 is_non_exhaustive: variant. is_field_list_non_exhaustive( ) ,
1549- } ) )
1552+ } ) ;
1553+ EntryKind :: Struct
15501554 }
15511555 hir:: ItemKind :: Union ( ..) => {
15521556 let adt_def = self . tcx . adt_def ( def_id) ;
15531557 record ! ( self . tables. repr_options[ def_id] <- adt_def. repr( ) ) ;
15541558
15551559 let variant = adt_def. non_enum_variant ( ) ;
1556- EntryKind :: Union ( self . lazy ( VariantData {
1560+ record ! ( self . tables . variant_data [ def_id ] <- VariantData {
15571561 ctor_kind: variant. ctor_kind,
15581562 discr: variant. discr,
15591563 ctor: None ,
15601564 is_non_exhaustive: variant. is_field_list_non_exhaustive( ) ,
1561- } ) )
1565+ } ) ;
1566+ EntryKind :: Union
15621567 }
15631568 hir:: ItemKind :: Impl ( hir:: Impl { defaultness, constness, .. } ) => {
15641569 self . tables . impl_defaultness . set ( def_id. index , * defaultness) ;
0 commit comments