@@ -458,21 +458,13 @@ impl<'a> Resolver<'a> {
458
458
self . current_module = if module. is_trait ( ) { module. parent . unwrap ( ) } else { module } ;
459
459
460
460
// Possibly apply the macro helper hack
461
- if self . use_extern_macros && kind == MacroKind :: Bang && path. len ( ) == 1 &&
461
+ if kind == MacroKind :: Bang && path. len ( ) == 1 &&
462
462
path[ 0 ] . span . ctxt ( ) . outer ( ) . expn_info ( ) . map_or ( false , |info| info. local_inner_macros ) {
463
463
let root = Ident :: new ( keywords:: DollarCrate . name ( ) , path[ 0 ] . span ) ;
464
464
path. insert ( 0 , root) ;
465
465
}
466
466
467
467
if path. len ( ) > 1 {
468
- if !self . use_extern_macros && self . gated_errors . insert ( span) {
469
- let msg = "non-ident macro paths are experimental" ;
470
- let feature = "use_extern_macros" ;
471
- emit_feature_err ( & self . session . parse_sess , feature, span, GateIssue :: Language , msg) ;
472
- self . found_unresolved_macro = true ;
473
- return Err ( Determinacy :: Determined ) ;
474
- }
475
-
476
468
let def = match self . resolve_path ( & path, Some ( MacroNS ) , false , span, CrateLint :: No ) {
477
469
PathResult :: NonModule ( path_res) => match path_res. base_def ( ) {
478
470
Def :: Err => Err ( Determinacy :: Determined ) ,
@@ -588,7 +580,6 @@ impl<'a> Resolver<'a> {
588
580
record_used : bool )
589
581
-> Option < MacroBinding < ' a > > {
590
582
let ident = ident. modern ( ) ;
591
- let mut possible_time_travel = None ;
592
583
let mut relative_depth: u32 = 0 ;
593
584
let mut binding = None ;
594
585
loop {
@@ -598,9 +589,6 @@ impl<'a> Resolver<'a> {
598
589
match invocation. expansion . get ( ) {
599
590
LegacyScope :: Invocation ( _) => scope. set ( invocation. legacy_scope . get ( ) ) ,
600
591
LegacyScope :: Empty => {
601
- if possible_time_travel. is_none ( ) {
602
- possible_time_travel = Some ( scope) ;
603
- }
604
592
scope = & invocation. legacy_scope ;
605
593
}
606
594
_ => {
@@ -615,7 +603,7 @@ impl<'a> Resolver<'a> {
615
603
}
616
604
LegacyScope :: Binding ( potential_binding) => {
617
605
if potential_binding. ident == ident {
618
- if ( ! self . use_extern_macros || record_used) && relative_depth > 0 {
606
+ if record_used && relative_depth > 0 {
619
607
self . disallowed_shadowing . push ( potential_binding) ;
620
608
}
621
609
binding = Some ( potential_binding) ;
@@ -629,21 +617,11 @@ impl<'a> Resolver<'a> {
629
617
let binding = if let Some ( binding) = binding {
630
618
MacroBinding :: Legacy ( binding)
631
619
} else if let Some ( binding) = self . global_macros . get ( & ident. name ) . cloned ( ) {
632
- if !self . use_extern_macros {
633
- self . record_use ( ident, MacroNS , binding, DUMMY_SP ) ;
634
- }
635
620
MacroBinding :: Global ( binding)
636
621
} else {
637
622
return None ;
638
623
} ;
639
624
640
- if !self . use_extern_macros {
641
- if let Some ( scope) = possible_time_travel {
642
- // Check for disallowed shadowing later
643
- self . lexical_macro_resolutions . push ( ( ident, scope) ) ;
644
- }
645
- }
646
-
647
625
Some ( binding)
648
626
}
649
627
@@ -749,9 +727,6 @@ impl<'a> Resolver<'a> {
749
727
find_best_match_for_name ( names, name, None )
750
728
// Then check modules.
751
729
} ) . or_else ( || {
752
- if !self . use_extern_macros {
753
- return None ;
754
- }
755
730
let is_macro = |def| {
756
731
if let Def :: Macro ( _, def_kind) = def {
757
732
def_kind == kind
0 commit comments