@@ -633,7 +633,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
633
633
}
634
634
635
635
fn maybe_kind ( & self , item_id : DefIndex ) -> Option < EntryKind > {
636
- self . root . per_def . kind . get ( self , item_id) . map ( |k| k. decode ( self ) )
636
+ self . root . tables . kind . get ( self , item_id) . map ( |k| k. decode ( self ) )
637
637
}
638
638
639
639
fn kind ( & self , item_id : DefIndex ) -> EntryKind {
@@ -665,7 +665,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
665
665
. expect ( "no name in item_ident" ) ;
666
666
let span = self
667
667
. root
668
- . per_def
668
+ . tables
669
669
. ident_span
670
670
. get ( self , item_index)
671
671
. map ( |data| data. decode ( ( self , sess) ) )
@@ -688,7 +688,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
688
688
}
689
689
690
690
fn get_span ( & self , index : DefIndex , sess : & Session ) -> Span {
691
- self . root . per_def . span . get ( self , index) . unwrap ( ) . decode ( ( self , sess) )
691
+ self . root . tables . span . get ( self , index) . unwrap ( ) . decode ( ( self , sess) )
692
692
}
693
693
694
694
fn load_proc_macro ( & self , id : DefIndex , sess : & Session ) -> SyntaxExtension {
@@ -781,7 +781,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
781
781
ctor_did,
782
782
data. discr ,
783
783
self . root
784
- . per_def
784
+ . tables
785
785
. children
786
786
. get ( self , index)
787
787
. unwrap_or ( Lazy :: empty ( ) )
@@ -812,7 +812,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
812
812
813
813
let variants = if let ty:: AdtKind :: Enum = adt_kind {
814
814
self . root
815
- . per_def
815
+ . tables
816
816
. children
817
817
. get ( self , item_id)
818
818
. unwrap_or ( Lazy :: empty ( ) )
@@ -831,7 +831,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
831
831
item_id : DefIndex ,
832
832
tcx : TyCtxt < ' tcx > ,
833
833
) -> ty:: GenericPredicates < ' tcx > {
834
- self . root . per_def . explicit_predicates . get ( self , item_id) . unwrap ( ) . decode ( ( self , tcx) )
834
+ self . root . tables . explicit_predicates . get ( self , item_id) . unwrap ( ) . decode ( ( self , tcx) )
835
835
}
836
836
837
837
fn get_inferred_outlives (
@@ -840,7 +840,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
840
840
tcx : TyCtxt < ' tcx > ,
841
841
) -> & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] {
842
842
self . root
843
- . per_def
843
+ . tables
844
844
. inferred_outlives
845
845
. get ( self , item_id)
846
846
. map ( |predicates| predicates. decode ( ( self , tcx) ) )
@@ -852,31 +852,31 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
852
852
item_id : DefIndex ,
853
853
tcx : TyCtxt < ' tcx > ,
854
854
) -> ty:: GenericPredicates < ' tcx > {
855
- self . root . per_def . super_predicates . get ( self , item_id) . unwrap ( ) . decode ( ( self , tcx) )
855
+ self . root . tables . super_predicates . get ( self , item_id) . unwrap ( ) . decode ( ( self , tcx) )
856
856
}
857
857
858
858
fn get_generics ( & self , item_id : DefIndex , sess : & Session ) -> ty:: Generics {
859
- self . root . per_def . generics . get ( self , item_id) . unwrap ( ) . decode ( ( self , sess) )
859
+ self . root . tables . generics . get ( self , item_id) . unwrap ( ) . decode ( ( self , sess) )
860
860
}
861
861
862
862
fn get_type ( & self , id : DefIndex , tcx : TyCtxt < ' tcx > ) -> Ty < ' tcx > {
863
- self . root . per_def . ty . get ( self , id) . unwrap ( ) . decode ( ( self , tcx) )
863
+ self . root . tables . ty . get ( self , id) . unwrap ( ) . decode ( ( self , tcx) )
864
864
}
865
865
866
866
fn get_stability ( & self , id : DefIndex ) -> Option < attr:: Stability > {
867
867
match self . is_proc_macro ( id) {
868
868
true => self . root . proc_macro_stability ,
869
- false => self . root . per_def . stability . get ( self , id) . map ( |stab| stab. decode ( self ) ) ,
869
+ false => self . root . tables . stability . get ( self , id) . map ( |stab| stab. decode ( self ) ) ,
870
870
}
871
871
}
872
872
873
873
fn get_const_stability ( & self , id : DefIndex ) -> Option < attr:: ConstStability > {
874
- self . root . per_def . const_stability . get ( self , id) . map ( |stab| stab. decode ( self ) )
874
+ self . root . tables . const_stability . get ( self , id) . map ( |stab| stab. decode ( self ) )
875
875
}
876
876
877
877
fn get_deprecation ( & self , id : DefIndex ) -> Option < attr:: Deprecation > {
878
878
self . root
879
- . per_def
879
+ . tables
880
880
. deprecation
881
881
. get ( self , id)
882
882
. filter ( |_| !self . is_proc_macro ( id) )
@@ -886,7 +886,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
886
886
fn get_visibility ( & self , id : DefIndex ) -> ty:: Visibility {
887
887
match self . is_proc_macro ( id) {
888
888
true => ty:: Visibility :: Public ,
889
- false => self . root . per_def . visibility . get ( self , id) . unwrap ( ) . decode ( self ) ,
889
+ false => self . root . tables . visibility . get ( self , id) . unwrap ( ) . decode ( self ) ,
890
890
}
891
891
}
892
892
@@ -914,7 +914,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
914
914
}
915
915
916
916
fn get_impl_trait ( & self , id : DefIndex , tcx : TyCtxt < ' tcx > ) -> Option < ty:: TraitRef < ' tcx > > {
917
- self . root . per_def . impl_trait_ref . get ( self , id) . map ( |tr| tr. decode ( ( self , tcx) ) )
917
+ self . root . tables . impl_trait_ref . get ( self , id) . map ( |tr| tr. decode ( ( self , tcx) ) )
918
918
}
919
919
920
920
/// Iterates over all the stability attributes in the given crate.
@@ -984,7 +984,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
984
984
985
985
// Iterate over all children.
986
986
let macros_only = self . dep_kind . lock ( ) . macros_only ( ) ;
987
- let children = self . root . per_def . children . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) ;
987
+ let children = self . root . tables . children . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) ;
988
988
for child_index in children. decode ( ( self , sess) ) {
989
989
if macros_only {
990
990
continue ;
@@ -1004,7 +1004,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1004
1004
EntryKind :: ForeignMod => {
1005
1005
let child_children = self
1006
1006
. root
1007
- . per_def
1007
+ . tables
1008
1008
. children
1009
1009
. get ( self , child_index)
1010
1010
. unwrap_or ( Lazy :: empty ( ) ) ;
@@ -1016,7 +1016,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1016
1016
vis : self . get_visibility ( child_index) ,
1017
1017
span : self
1018
1018
. root
1019
- . per_def
1019
+ . tables
1020
1020
. span
1021
1021
. get ( self , child_index)
1022
1022
. unwrap ( )
@@ -1096,13 +1096,13 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1096
1096
}
1097
1097
1098
1098
fn is_item_mir_available ( & self , id : DefIndex ) -> bool {
1099
- !self . is_proc_macro ( id) && self . root . per_def . mir . get ( self , id) . is_some ( )
1099
+ !self . is_proc_macro ( id) && self . root . tables . mir . get ( self , id) . is_some ( )
1100
1100
}
1101
1101
1102
1102
fn get_optimized_mir ( & self , tcx : TyCtxt < ' tcx > , id : DefIndex ) -> BodyAndCache < ' tcx > {
1103
1103
let mut cache = self
1104
1104
. root
1105
- . per_def
1105
+ . tables
1106
1106
. mir
1107
1107
. get ( self , id)
1108
1108
. filter ( |_| !self . is_proc_macro ( id) )
@@ -1121,7 +1121,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1121
1121
) -> IndexVec < Promoted , BodyAndCache < ' tcx > > {
1122
1122
let mut cache = self
1123
1123
. root
1124
- . per_def
1124
+ . tables
1125
1125
. promoted_mir
1126
1126
. get ( self , id)
1127
1127
. filter ( |_| !self . is_proc_macro ( id) )
@@ -1172,7 +1172,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1172
1172
}
1173
1173
1174
1174
fn get_item_variances ( & self , id : DefIndex ) -> Vec < ty:: Variance > {
1175
- self . root . per_def . variances . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) . decode ( self ) . collect ( )
1175
+ self . root . tables . variances . get ( self , id) . unwrap_or ( Lazy :: empty ( ) ) . decode ( self ) . collect ( )
1176
1176
}
1177
1177
1178
1178
fn get_ctor_kind ( & self , node_id : DefIndex ) -> CtorKind {
@@ -1209,7 +1209,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1209
1209
1210
1210
Lrc :: from (
1211
1211
self . root
1212
- . per_def
1212
+ . tables
1213
1213
. attributes
1214
1214
. get ( self , item_id)
1215
1215
. unwrap_or ( Lazy :: empty ( ) )
@@ -1220,7 +1220,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1220
1220
1221
1221
fn get_struct_field_names ( & self , id : DefIndex , sess : & Session ) -> Vec < Spanned < ast:: Name > > {
1222
1222
self . root
1223
- . per_def
1223
+ . tables
1224
1224
. children
1225
1225
. get ( self , id)
1226
1226
. unwrap_or ( Lazy :: empty ( ) )
@@ -1236,7 +1236,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1236
1236
) -> & ' tcx [ DefId ] {
1237
1237
tcx. arena . alloc_from_iter (
1238
1238
self . root
1239
- . per_def
1239
+ . tables
1240
1240
. inherent_impls
1241
1241
. get ( self , id)
1242
1242
. unwrap_or ( Lazy :: empty ( ) )
@@ -1416,7 +1416,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1416
1416
}
1417
1417
1418
1418
fn fn_sig ( & self , id : DefIndex , tcx : TyCtxt < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
1419
- self . root . per_def . fn_sig . get ( self , id) . unwrap ( ) . decode ( ( self , tcx) )
1419
+ self . root . tables . fn_sig . get ( self , id) . unwrap ( ) . decode ( ( self , tcx) )
1420
1420
}
1421
1421
1422
1422
#[ inline]
0 commit comments