@@ -922,7 +922,6 @@ pub struct Resolver<'a> {
922922 dummy_ext_bang : Lrc < SyntaxExtension > ,
923923 dummy_ext_derive : Lrc < SyntaxExtension > ,
924924 non_macro_attrs : [ Lrc < SyntaxExtension > ; 2 ] ,
925- macro_defs : FxHashMap < ExpnId , DefId > ,
926925 local_macro_def_scopes : FxHashMap < NodeId , Module < ' a > > ,
927926 ast_transform_scopes : FxHashMap < ExpnId , Module < ' a > > ,
928927 unused_macros : NodeMap < Span > ,
@@ -1152,9 +1151,6 @@ impl<'a> Resolver<'a> {
11521151 let mut invocation_parent_scopes = FxHashMap :: default ( ) ;
11531152 invocation_parent_scopes. insert ( ExpnId :: root ( ) , ParentScope :: module ( graph_root) ) ;
11541153
1155- let mut macro_defs = FxHashMap :: default ( ) ;
1156- macro_defs. insert ( ExpnId :: root ( ) , root_def_id) ;
1157-
11581154 let features = session. features_untracked ( ) ;
11591155 let non_macro_attr =
11601156 |mark_used| Lrc :: new ( SyntaxExtension :: non_macro_attr ( mark_used, session. edition ( ) ) ) ;
@@ -1229,7 +1225,6 @@ impl<'a> Resolver<'a> {
12291225 invocation_parent_scopes,
12301226 output_macro_rules_scopes : Default :: default ( ) ,
12311227 helper_attrs : Default :: default ( ) ,
1232- macro_defs,
12331228 local_macro_def_scopes : FxHashMap :: default ( ) ,
12341229 name_already_seen : FxHashMap :: default ( ) ,
12351230 potentially_unused_imports : Vec :: new ( ) ,
@@ -1335,8 +1330,8 @@ impl<'a> Resolver<'a> {
13351330
13361331 fn macro_def ( & self , mut ctxt : SyntaxContext ) -> DefId {
13371332 loop {
1338- match self . macro_defs . get ( & ctxt. outer_expn ( ) ) {
1339- Some ( & def_id) => return def_id,
1333+ match ctxt. outer_expn ( ) . expn_data ( ) . macro_def_id {
1334+ Some ( def_id) => return def_id,
13401335 None => ctxt. remove_mark ( ) ,
13411336 } ;
13421337 }
@@ -1820,7 +1815,7 @@ impl<'a> Resolver<'a> {
18201815 && module. expansion . is_descendant_of ( parent. expansion )
18211816 {
18221817 // The macro is a proc macro derive
1823- if let Some ( & def_id) = self . macro_defs . get ( & module. expansion ) {
1818+ if let Some ( def_id) = module. expansion . expn_data ( ) . macro_def_id {
18241819 if let Some ( ext) = self . get_macro_by_def_id ( def_id) {
18251820 if !ext. is_builtin && ext. macro_kind ( ) == MacroKind :: Derive {
18261821 if parent. expansion . outer_expn_is_descendant_of ( span. ctxt ( ) ) {
0 commit comments