@@ -15,7 +15,7 @@ use std::borrow::Borrow;
15
15
use std:: fmt:: Write ;
16
16
use std:: hash:: Hash ;
17
17
use syntax:: ast;
18
- use syntax:: ext:: hygiene:: Mark ;
18
+ use syntax:: ext:: hygiene:: ExpnId ;
19
19
use syntax:: symbol:: { Symbol , sym, InternedString } ;
20
20
use syntax_pos:: { Span , DUMMY_SP } ;
21
21
use crate :: util:: nodemap:: NodeMap ;
@@ -93,16 +93,16 @@ pub struct Definitions {
93
93
node_to_def_index : NodeMap < DefIndex > ,
94
94
def_index_to_node : Vec < ast:: NodeId > ,
95
95
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,
97
97
/// 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 > ,
101
101
next_disambiguator : FxHashMap < ( DefIndex , DefPathData ) , u32 > ,
102
102
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 `
104
104
/// 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 > ,
106
106
}
107
107
108
108
/// A unique identifier that we can use to lookup a definition
@@ -437,7 +437,7 @@ impl Definitions {
437
437
assert ! ( self . def_index_to_node. is_empty( ) ) ;
438
438
self . def_index_to_node . push ( ast:: CRATE_NODE_ID ) ;
439
439
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) ;
441
441
442
442
// Allocate some other DefIndices that always must exist.
443
443
GlobalMetaDataKind :: allocate_def_indices ( self ) ;
@@ -450,7 +450,7 @@ impl Definitions {
450
450
parent : DefIndex ,
451
451
node_id : ast:: NodeId ,
452
452
data : DefPathData ,
453
- expansion : Mark ,
453
+ expn_id : ExpnId ,
454
454
span : Span )
455
455
-> DefIndex {
456
456
debug ! ( "create_def_with_parent(parent={:?}, node_id={:?}, data={:?})" ,
@@ -498,8 +498,8 @@ impl Definitions {
498
498
self . node_to_def_index . insert ( node_id, index) ;
499
499
}
500
500
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 ) ;
503
503
}
504
504
505
505
// The span is added if it isn't dummy
@@ -519,23 +519,23 @@ impl Definitions {
519
519
self . node_to_hir_id = mapping;
520
520
}
521
521
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 ( ) )
524
524
}
525
525
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 ]
528
528
}
529
529
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) ;
532
532
}
533
533
534
- pub fn invocation_parent ( & self , invoc_id : Mark ) -> DefIndex {
534
+ pub fn invocation_parent ( & self , invoc_id : ExpnId ) -> DefIndex {
535
535
self . invocation_parents [ & invoc_id]
536
536
}
537
537
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 ) {
539
539
let old_parent = self . invocation_parents . insert ( invoc_id, parent) ;
540
540
assert ! ( old_parent. is_none( ) , "parent def-index is reset for an invocation" ) ;
541
541
}
@@ -624,7 +624,7 @@ macro_rules! define_global_metadata_kind {
624
624
CRATE_DEF_INDEX ,
625
625
ast:: DUMMY_NODE_ID ,
626
626
DefPathData :: GlobalMetaData ( instance. name( ) . as_interned_str( ) ) ,
627
- Mark :: root( ) ,
627
+ ExpnId :: root( ) ,
628
628
DUMMY_SP
629
629
) ;
630
630
0 commit comments