@@ -4,7 +4,6 @@ use crate::creader::{CStore, CrateMetadataRef};
44use crate :: rmeta:: * ;
55
66use rustc_ast as ast;
7- use rustc_ast:: ptr:: P ;
87use rustc_data_structures:: captures:: Captures ;
98use rustc_data_structures:: fx:: FxHashMap ;
109use rustc_data_structures:: svh:: Svh ;
@@ -1025,10 +1024,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10251024 let vis = self . get_visibility ( child_index) ;
10261025 let span = self . get_span ( child_index, sess) ;
10271026 let macro_rules = match kind {
1028- DefKind :: Macro ( ..) => match self . kind ( child_index) {
1029- EntryKind :: MacroDef ( _, macro_rules) => macro_rules,
1030- _ => unreachable ! ( ) ,
1031- } ,
1027+ DefKind :: Macro ( ..) => {
1028+ self . root
1029+ . tables
1030+ . macro_definition
1031+ . get ( self , child_index)
1032+ . unwrap ( )
1033+ . decode ( ( self , sess) )
1034+ . macro_rules
1035+ }
10321036 _ => false ,
10331037 } ;
10341038
@@ -1344,8 +1348,8 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
13441348
13451349 fn get_macro ( self , id : DefIndex , sess : & Session ) -> ast:: MacroDef {
13461350 match self . kind ( id) {
1347- EntryKind :: MacroDef ( mac_args , macro_rules ) => {
1348- ast :: MacroDef { body : P ( mac_args . decode ( ( self , sess) ) ) , macro_rules }
1351+ EntryKind :: MacroDef => {
1352+ self . root . tables . macro_definition . get ( self , id ) . unwrap ( ) . decode ( ( self , sess) )
13491353 }
13501354 _ => bug ! ( ) ,
13511355 }
0 commit comments