@@ -633,7 +633,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
633633 }
634634
635635 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 ) )
637637 }
638638
639639 fn kind ( & self , item_id : DefIndex ) -> EntryKind {
@@ -665,7 +665,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
665665 . expect ( "no name in item_ident" ) ;
666666 let span = self
667667 . root
668- . per_def
668+ . tables
669669 . ident_span
670670 . get ( self , item_index)
671671 . map ( |data| data. decode ( ( self , sess) ) )
@@ -688,7 +688,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
688688 }
689689
690690 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) )
692692 }
693693
694694 fn load_proc_macro ( & self , id : DefIndex , sess : & Session ) -> SyntaxExtension {
@@ -781,7 +781,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
781781 ctor_did,
782782 data. discr ,
783783 self . root
784- . per_def
784+ . tables
785785 . children
786786 . get ( self , index)
787787 . unwrap_or ( Lazy :: empty ( ) )
@@ -812,7 +812,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
812812
813813 let variants = if let ty:: AdtKind :: Enum = adt_kind {
814814 self . root
815- . per_def
815+ . tables
816816 . children
817817 . get ( self , item_id)
818818 . unwrap_or ( Lazy :: empty ( ) )
@@ -831,7 +831,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
831831 item_id : DefIndex ,
832832 tcx : TyCtxt < ' tcx > ,
833833 ) -> 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) )
835835 }
836836
837837 fn get_inferred_outlives (
@@ -840,7 +840,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
840840 tcx : TyCtxt < ' tcx > ,
841841 ) -> & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] {
842842 self . root
843- . per_def
843+ . tables
844844 . inferred_outlives
845845 . get ( self , item_id)
846846 . map ( |predicates| predicates. decode ( ( self , tcx) ) )
@@ -852,31 +852,31 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
852852 item_id : DefIndex ,
853853 tcx : TyCtxt < ' tcx > ,
854854 ) -> 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) )
856856 }
857857
858858 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) )
860860 }
861861
862862 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) )
864864 }
865865
866866 fn get_stability ( & self , id : DefIndex ) -> Option < attr:: Stability > {
867867 match self . is_proc_macro ( id) {
868868 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 ) ) ,
870870 }
871871 }
872872
873873 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 ) )
875875 }
876876
877877 fn get_deprecation ( & self , id : DefIndex ) -> Option < attr:: Deprecation > {
878878 self . root
879- . per_def
879+ . tables
880880 . deprecation
881881 . get ( self , id)
882882 . filter ( |_| !self . is_proc_macro ( id) )
@@ -886,7 +886,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
886886 fn get_visibility ( & self , id : DefIndex ) -> ty:: Visibility {
887887 match self . is_proc_macro ( id) {
888888 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 ) ,
890890 }
891891 }
892892
@@ -914,7 +914,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
914914 }
915915
916916 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) ) )
918918 }
919919
920920 /// Iterates over all the stability attributes in the given crate.
@@ -984,7 +984,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
984984
985985 // Iterate over all children.
986986 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 ( ) ) ;
988988 for child_index in children. decode ( ( self , sess) ) {
989989 if macros_only {
990990 continue ;
@@ -1004,7 +1004,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10041004 EntryKind :: ForeignMod => {
10051005 let child_children = self
10061006 . root
1007- . per_def
1007+ . tables
10081008 . children
10091009 . get ( self , child_index)
10101010 . unwrap_or ( Lazy :: empty ( ) ) ;
@@ -1016,7 +1016,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10161016 vis : self . get_visibility ( child_index) ,
10171017 span : self
10181018 . root
1019- . per_def
1019+ . tables
10201020 . span
10211021 . get ( self , child_index)
10221022 . unwrap ( )
@@ -1096,13 +1096,13 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10961096 }
10971097
10981098 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 ( )
11001100 }
11011101
11021102 fn get_optimized_mir ( & self , tcx : TyCtxt < ' tcx > , id : DefIndex ) -> BodyAndCache < ' tcx > {
11031103 let mut cache = self
11041104 . root
1105- . per_def
1105+ . tables
11061106 . mir
11071107 . get ( self , id)
11081108 . filter ( |_| !self . is_proc_macro ( id) )
@@ -1121,7 +1121,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11211121 ) -> IndexVec < Promoted , BodyAndCache < ' tcx > > {
11221122 let mut cache = self
11231123 . root
1124- . per_def
1124+ . tables
11251125 . promoted_mir
11261126 . get ( self , id)
11271127 . filter ( |_| !self . is_proc_macro ( id) )
@@ -1172,7 +1172,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11721172 }
11731173
11741174 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 ( )
11761176 }
11771177
11781178 fn get_ctor_kind ( & self , node_id : DefIndex ) -> CtorKind {
@@ -1209,7 +1209,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12091209
12101210 Lrc :: from (
12111211 self . root
1212- . per_def
1212+ . tables
12131213 . attributes
12141214 . get ( self , item_id)
12151215 . unwrap_or ( Lazy :: empty ( ) )
@@ -1220,7 +1220,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12201220
12211221 fn get_struct_field_names ( & self , id : DefIndex , sess : & Session ) -> Vec < Spanned < ast:: Name > > {
12221222 self . root
1223- . per_def
1223+ . tables
12241224 . children
12251225 . get ( self , id)
12261226 . unwrap_or ( Lazy :: empty ( ) )
@@ -1236,7 +1236,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12361236 ) -> & ' tcx [ DefId ] {
12371237 tcx. arena . alloc_from_iter (
12381238 self . root
1239- . per_def
1239+ . tables
12401240 . inherent_impls
12411241 . get ( self , id)
12421242 . unwrap_or ( Lazy :: empty ( ) )
@@ -1416,7 +1416,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14161416 }
14171417
14181418 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) )
14201420 }
14211421
14221422 #[ inline]
0 commit comments