@@ -84,21 +84,21 @@ pub struct LegacyBinding<'a> {
84
84
#[ derive( Copy , Clone ) ]
85
85
pub enum MacroBinding < ' a > {
86
86
Legacy ( & ' a LegacyBinding < ' a > ) ,
87
- Builtin ( & ' a NameBinding < ' a > ) ,
87
+ Global ( & ' a NameBinding < ' a > ) ,
88
88
Modern ( & ' a NameBinding < ' a > ) ,
89
89
}
90
90
91
91
impl < ' a > MacroBinding < ' a > {
92
92
pub fn span ( self ) -> Span {
93
93
match self {
94
94
MacroBinding :: Legacy ( binding) => binding. span ,
95
- MacroBinding :: Builtin ( binding) | MacroBinding :: Modern ( binding) => binding. span ,
95
+ MacroBinding :: Global ( binding) | MacroBinding :: Modern ( binding) => binding. span ,
96
96
}
97
97
}
98
98
99
99
pub fn binding ( self ) -> & ' a NameBinding < ' a > {
100
100
match self {
101
- MacroBinding :: Builtin ( binding) | MacroBinding :: Modern ( binding) => binding,
101
+ MacroBinding :: Global ( binding) | MacroBinding :: Modern ( binding) => binding,
102
102
MacroBinding :: Legacy ( _) => panic ! ( "unexpected MacroBinding::Legacy" ) ,
103
103
}
104
104
}
@@ -189,7 +189,7 @@ impl<'a> base::Resolver for Resolver<'a> {
189
189
vis : ty:: Visibility :: Invisible ,
190
190
expansion : Mark :: root ( ) ,
191
191
} ) ;
192
- self . builtin_macros . insert ( ident. name , binding) ;
192
+ self . global_macros . insert ( ident. name , binding) ;
193
193
}
194
194
195
195
fn resolve_imports ( & mut self ) {
@@ -207,7 +207,7 @@ impl<'a> base::Resolver for Resolver<'a> {
207
207
attr:: mark_known ( & attrs[ i] ) ;
208
208
}
209
209
210
- match self . builtin_macros . get ( & name) . cloned ( ) {
210
+ match self . global_macros . get ( & name) . cloned ( ) {
211
211
Some ( binding) => match * binding. get_macro ( self ) {
212
212
MultiModifier ( ..) | MultiDecorator ( ..) | SyntaxExtension :: AttrProcMacro ( ..) => {
213
213
return Some ( attrs. remove ( i) )
@@ -239,7 +239,7 @@ impl<'a> base::Resolver for Resolver<'a> {
239
239
}
240
240
let trait_name = traits[ j] . segments [ 0 ] . identifier . name ;
241
241
let legacy_name = Symbol :: intern ( & format ! ( "derive_{}" , trait_name) ) ;
242
- if !self . builtin_macros . contains_key ( & legacy_name) {
242
+ if !self . global_macros . contains_key ( & legacy_name) {
243
243
continue
244
244
}
245
245
let span = traits. remove ( j) . span ;
@@ -429,13 +429,13 @@ impl<'a> Resolver<'a> {
429
429
loop {
430
430
let result = if let Some ( module) = module {
431
431
// Since expanded macros may not shadow the lexical scope and
432
- // globs may not shadow builtin macros (both enforced below),
432
+ // globs may not shadow global macros (both enforced below),
433
433
// we resolve with restricted shadowing (indicated by the penultimate argument).
434
434
self . resolve_ident_in_module ( module, ident, ns, true , record_used)
435
435
. map ( MacroBinding :: Modern )
436
436
} else {
437
- self . builtin_macros . get ( & ident. name ) . cloned ( ) . ok_or ( determinacy)
438
- . map ( MacroBinding :: Builtin )
437
+ self . global_macros . get ( & ident. name ) . cloned ( ) . ok_or ( determinacy)
438
+ . map ( MacroBinding :: Global )
439
439
} ;
440
440
441
441
match result. map ( MacroBinding :: binding) {
@@ -520,11 +520,11 @@ impl<'a> Resolver<'a> {
520
520
521
521
let binding = if let Some ( binding) = binding {
522
522
MacroBinding :: Legacy ( binding)
523
- } else if let Some ( binding) = self . builtin_macros . get ( & name) . cloned ( ) {
523
+ } else if let Some ( binding) = self . global_macros . get ( & name) . cloned ( ) {
524
524
if !self . use_extern_macros {
525
525
self . record_use ( Ident :: with_empty_ctxt ( name) , MacroNS , binding, DUMMY_SP ) ;
526
526
}
527
- MacroBinding :: Builtin ( binding)
527
+ MacroBinding :: Global ( binding)
528
528
} else {
529
529
return None ;
530
530
} ;
@@ -564,7 +564,7 @@ impl<'a> Resolver<'a> {
564
564
. span_note ( binding. span , & msg2)
565
565
. emit ( ) ;
566
566
} ,
567
- ( Some ( MacroBinding :: Builtin ( binding) ) , Ok ( MacroBinding :: Builtin ( _) ) ) => {
567
+ ( Some ( MacroBinding :: Global ( binding) ) , Ok ( MacroBinding :: Global ( _) ) ) => {
568
568
self . record_use ( ident, MacroNS , binding, span) ;
569
569
self . err_if_macro_use_proc_macro ( ident. name , span, binding) ;
570
570
} ,
@@ -593,11 +593,11 @@ impl<'a> Resolver<'a> {
593
593
find_best_match_for_name ( self . macro_names . iter ( ) , name, None )
594
594
} else {
595
595
None
596
- // Then check builtin macros.
596
+ // Then check global macros.
597
597
} . or_else ( || {
598
598
// FIXME: get_macro needs an &mut Resolver, can we do it without cloning?
599
- let builtin_macros = self . builtin_macros . clone ( ) ;
600
- let names = builtin_macros . iter ( ) . filter_map ( |( name, binding) | {
599
+ let global_macros = self . global_macros . clone ( ) ;
600
+ let names = global_macros . iter ( ) . filter_map ( |( name, binding) | {
601
601
if binding. get_macro ( self ) . kind ( ) == kind {
602
602
Some ( name)
603
603
} else {
0 commit comments