@@ -4,7 +4,6 @@ use crate::creader::{CStore, CrateMetadataRef};
4
4
use crate :: rmeta:: * ;
5
5
6
6
use rustc_ast as ast;
7
- use rustc_ast:: ptr:: P ;
8
7
use rustc_data_structures:: captures:: Captures ;
9
8
use rustc_data_structures:: fx:: FxHashMap ;
10
9
use rustc_data_structures:: svh:: Svh ;
@@ -1025,10 +1024,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1025
1024
let vis = self . get_visibility ( child_index) ;
1026
1025
let span = self . get_span ( child_index, sess) ;
1027
1026
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
+ }
1032
1036
_ => false ,
1033
1037
} ;
1034
1038
@@ -1344,8 +1348,8 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1344
1348
1345
1349
fn get_macro ( self , id : DefIndex , sess : & Session ) -> ast:: MacroDef {
1346
1350
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) )
1349
1353
}
1350
1354
_ => bug ! ( ) ,
1351
1355
}
0 commit comments