@@ -84,21 +84,21 @@ pub struct LegacyBinding<'a> {
8484#[ derive( Copy , Clone ) ]
8585pub enum MacroBinding < ' a > {
8686 Legacy ( & ' a LegacyBinding < ' a > ) ,
87- Builtin ( & ' a NameBinding < ' a > ) ,
87+ Global ( & ' a NameBinding < ' a > ) ,
8888 Modern ( & ' a NameBinding < ' a > ) ,
8989}
9090
9191impl < ' a > MacroBinding < ' a > {
9292 pub fn span ( self ) -> Span {
9393 match self {
9494 MacroBinding :: Legacy ( binding) => binding. span ,
95- MacroBinding :: Builtin ( binding) | MacroBinding :: Modern ( binding) => binding. span ,
95+ MacroBinding :: Global ( binding) | MacroBinding :: Modern ( binding) => binding. span ,
9696 }
9797 }
9898
9999 pub fn binding ( self ) -> & ' a NameBinding < ' a > {
100100 match self {
101- MacroBinding :: Builtin ( binding) | MacroBinding :: Modern ( binding) => binding,
101+ MacroBinding :: Global ( binding) | MacroBinding :: Modern ( binding) => binding,
102102 MacroBinding :: Legacy ( _) => panic ! ( "unexpected MacroBinding::Legacy" ) ,
103103 }
104104 }
@@ -189,7 +189,7 @@ impl<'a> base::Resolver for Resolver<'a> {
189189 vis : ty:: Visibility :: Invisible ,
190190 expansion : Mark :: root ( ) ,
191191 } ) ;
192- self . builtin_macros . insert ( ident. name , binding) ;
192+ self . global_macros . insert ( ident. name , binding) ;
193193 }
194194
195195 fn resolve_imports ( & mut self ) {
@@ -207,7 +207,7 @@ impl<'a> base::Resolver for Resolver<'a> {
207207 attr:: mark_known ( & attrs[ i] ) ;
208208 }
209209
210- match self . builtin_macros . get ( & name) . cloned ( ) {
210+ match self . global_macros . get ( & name) . cloned ( ) {
211211 Some ( binding) => match * binding. get_macro ( self ) {
212212 MultiModifier ( ..) | MultiDecorator ( ..) | SyntaxExtension :: AttrProcMacro ( ..) => {
213213 return Some ( attrs. remove ( i) )
@@ -239,7 +239,7 @@ impl<'a> base::Resolver for Resolver<'a> {
239239 }
240240 let trait_name = traits[ j] . segments [ 0 ] . identifier . name ;
241241 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) {
243243 continue
244244 }
245245 let span = traits. remove ( j) . span ;
@@ -429,13 +429,13 @@ impl<'a> Resolver<'a> {
429429 loop {
430430 let result = if let Some ( module) = module {
431431 // 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),
433433 // we resolve with restricted shadowing (indicated by the penultimate argument).
434434 self . resolve_ident_in_module ( module, ident, ns, true , record_used)
435435 . map ( MacroBinding :: Modern )
436436 } 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 )
439439 } ;
440440
441441 match result. map ( MacroBinding :: binding) {
@@ -520,11 +520,11 @@ impl<'a> Resolver<'a> {
520520
521521 let binding = if let Some ( binding) = binding {
522522 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 ( ) {
524524 if !self . use_extern_macros {
525525 self . record_use ( Ident :: with_empty_ctxt ( name) , MacroNS , binding, DUMMY_SP ) ;
526526 }
527- MacroBinding :: Builtin ( binding)
527+ MacroBinding :: Global ( binding)
528528 } else {
529529 return None ;
530530 } ;
@@ -564,7 +564,7 @@ impl<'a> Resolver<'a> {
564564 . span_note ( binding. span , & msg2)
565565 . emit ( ) ;
566566 } ,
567- ( Some ( MacroBinding :: Builtin ( binding) ) , Ok ( MacroBinding :: Builtin ( _) ) ) => {
567+ ( Some ( MacroBinding :: Global ( binding) ) , Ok ( MacroBinding :: Global ( _) ) ) => {
568568 self . record_use ( ident, MacroNS , binding, span) ;
569569 self . err_if_macro_use_proc_macro ( ident. name , span, binding) ;
570570 } ,
@@ -593,11 +593,11 @@ impl<'a> Resolver<'a> {
593593 find_best_match_for_name ( self . macro_names . iter ( ) , name, None )
594594 } else {
595595 None
596- // Then check builtin macros.
596+ // Then check global macros.
597597 } . or_else ( || {
598598 // 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) | {
601601 if binding. get_macro ( self ) . kind ( ) == kind {
602602 Some ( name)
603603 } else {
0 commit comments