@@ -15,7 +15,7 @@ use std::borrow::Borrow;
1515use std:: fmt:: Write ;
1616use std:: hash:: Hash ;
1717use syntax:: ast;
18- use syntax:: ext:: hygiene:: Mark ;
18+ use syntax:: ext:: hygiene:: ExpnId ;
1919use syntax:: symbol:: { Symbol , sym, InternedString } ;
2020use syntax_pos:: { Span , DUMMY_SP } ;
2121use crate :: util:: nodemap:: NodeMap ;
@@ -93,16 +93,16 @@ pub struct Definitions {
9393 node_to_def_index : NodeMap < DefIndex > ,
9494 def_index_to_node : Vec < ast:: NodeId > ,
9595 pub ( super ) node_to_hir_id : IndexVec < ast:: NodeId , hir:: HirId > ,
96- /// If `Mark ` is an ID of some macro expansion,
96+ /// If `ExpnId ` is an ID of some macro expansion,
9797 /// then `DefId` is the normal module (`mod`) in which the expanded macro was defined.
98- parent_modules_of_macro_defs : FxHashMap < Mark , DefId > ,
99- /// Item with a given `DefIndex` was defined during macro expansion with ID `Mark `.
100- expansions_that_defined : FxHashMap < DefIndex , Mark > ,
98+ parent_modules_of_macro_defs : FxHashMap < ExpnId , DefId > ,
99+ /// Item with a given `DefIndex` was defined during macro expansion with ID `ExpnId `.
100+ expansions_that_defined : FxHashMap < DefIndex , ExpnId > ,
101101 next_disambiguator : FxHashMap < ( DefIndex , DefPathData ) , u32 > ,
102102 def_index_to_span : FxHashMap < DefIndex , Span > ,
103- /// When collecting definitions from an AST fragment produced by a macro invocation `Mark `
103+ /// When collecting definitions from an AST fragment produced by a macro invocation `ExpnId `
104104 /// we know what parent node that fragment should be attached to thanks to this table.
105- invocation_parents : FxHashMap < Mark , DefIndex > ,
105+ invocation_parents : FxHashMap < ExpnId , DefIndex > ,
106106}
107107
108108/// A unique identifier that we can use to lookup a definition
@@ -437,7 +437,7 @@ impl Definitions {
437437 assert ! ( self . def_index_to_node. is_empty( ) ) ;
438438 self . def_index_to_node . push ( ast:: CRATE_NODE_ID ) ;
439439 self . node_to_def_index . insert ( ast:: CRATE_NODE_ID , root_index) ;
440- self . set_invocation_parent ( Mark :: root ( ) , root_index) ;
440+ self . set_invocation_parent ( ExpnId :: root ( ) , root_index) ;
441441
442442 // Allocate some other DefIndices that always must exist.
443443 GlobalMetaDataKind :: allocate_def_indices ( self ) ;
@@ -450,7 +450,7 @@ impl Definitions {
450450 parent : DefIndex ,
451451 node_id : ast:: NodeId ,
452452 data : DefPathData ,
453- expansion : Mark ,
453+ expn_id : ExpnId ,
454454 span : Span )
455455 -> DefIndex {
456456 debug ! ( "create_def_with_parent(parent={:?}, node_id={:?}, data={:?})" ,
@@ -498,8 +498,8 @@ impl Definitions {
498498 self . node_to_def_index . insert ( node_id, index) ;
499499 }
500500
501- if expansion != Mark :: root ( ) {
502- self . expansions_that_defined . insert ( index, expansion ) ;
501+ if expn_id != ExpnId :: root ( ) {
502+ self . expansions_that_defined . insert ( index, expn_id ) ;
503503 }
504504
505505 // The span is added if it isn't dummy
@@ -519,23 +519,23 @@ impl Definitions {
519519 self . node_to_hir_id = mapping;
520520 }
521521
522- pub fn expansion_that_defined ( & self , index : DefIndex ) -> Mark {
523- self . expansions_that_defined . get ( & index) . cloned ( ) . unwrap_or ( Mark :: root ( ) )
522+ pub fn expansion_that_defined ( & self , index : DefIndex ) -> ExpnId {
523+ self . expansions_that_defined . get ( & index) . cloned ( ) . unwrap_or ( ExpnId :: root ( ) )
524524 }
525525
526- pub fn parent_module_of_macro_def ( & self , mark : Mark ) -> DefId {
527- self . parent_modules_of_macro_defs [ & mark ]
526+ pub fn parent_module_of_macro_def ( & self , expn_id : ExpnId ) -> DefId {
527+ self . parent_modules_of_macro_defs [ & expn_id ]
528528 }
529529
530- pub fn add_parent_module_of_macro_def ( & mut self , mark : Mark , module : DefId ) {
531- self . parent_modules_of_macro_defs . insert ( mark , module) ;
530+ pub fn add_parent_module_of_macro_def ( & mut self , expn_id : ExpnId , module : DefId ) {
531+ self . parent_modules_of_macro_defs . insert ( expn_id , module) ;
532532 }
533533
534- pub fn invocation_parent ( & self , invoc_id : Mark ) -> DefIndex {
534+ pub fn invocation_parent ( & self , invoc_id : ExpnId ) -> DefIndex {
535535 self . invocation_parents [ & invoc_id]
536536 }
537537
538- pub fn set_invocation_parent ( & mut self , invoc_id : Mark , parent : DefIndex ) {
538+ pub fn set_invocation_parent ( & mut self , invoc_id : ExpnId , parent : DefIndex ) {
539539 let old_parent = self . invocation_parents . insert ( invoc_id, parent) ;
540540 assert ! ( old_parent. is_none( ) , "parent def-index is reset for an invocation" ) ;
541541 }
@@ -624,7 +624,7 @@ macro_rules! define_global_metadata_kind {
624624 CRATE_DEF_INDEX ,
625625 ast:: DUMMY_NODE_ID ,
626626 DefPathData :: GlobalMetaData ( instance. name( ) . as_interned_str( ) ) ,
627- Mark :: root( ) ,
627+ ExpnId :: root( ) ,
628628 DUMMY_SP
629629 ) ;
630630
0 commit comments