@@ -77,7 +77,7 @@ use std::mem::replace;
7777use std:: rc:: Rc ;
7878
7979use resolve_imports:: { ImportDirective , NameResolution } ;
80- use macros:: { InvocationData , LegacyBinding } ;
80+ use macros:: { InvocationData , LegacyBinding , LegacyScope } ;
8181
8282// NB: This module needs to be declared first so diagnostics are
8383// registered before they are used.
@@ -1077,6 +1077,7 @@ pub struct Resolver<'a> {
10771077 crate_loader : & ' a mut CrateLoader ,
10781078 macro_names : FnvHashSet < Name > ,
10791079 builtin_macros : FnvHashMap < Name , Rc < SyntaxExtension > > ,
1080+ lexical_macro_resolutions : Vec < ( Name , LegacyScope < ' a > ) > ,
10801081
10811082 // Maps the `Mark` of an expansion to its containing module or block.
10821083 invocations : FnvHashMap < Mark , & ' a InvocationData < ' a > > ,
@@ -1267,6 +1268,7 @@ impl<'a> Resolver<'a> {
12671268 crate_loader : crate_loader,
12681269 macro_names : FnvHashSet ( ) ,
12691270 builtin_macros : FnvHashMap ( ) ,
1271+ lexical_macro_resolutions : Vec :: new ( ) ,
12701272 invocations : invocations,
12711273 }
12721274 }
@@ -3363,9 +3365,13 @@ impl<'a> Resolver<'a> {
33633365 }
33643366
33653367 fn report_shadowing_errors ( & mut self ) {
3368+ for ( name, scope) in replace ( & mut self . lexical_macro_resolutions , Vec :: new ( ) ) {
3369+ self . resolve_macro_name ( scope, name) ;
3370+ }
3371+
33663372 let mut reported_errors = FnvHashSet ( ) ;
33673373 for binding in replace ( & mut self . disallowed_shadowing , Vec :: new ( ) ) {
3368- if self . resolve_macro_name ( binding. parent , binding. name , false ) . is_some ( ) &&
3374+ if self . resolve_macro_name ( binding. parent , binding. name ) . is_some ( ) &&
33693375 reported_errors. insert ( ( binding. name , binding. span ) ) {
33703376 let msg = format ! ( "`{}` is already in scope" , binding. name) ;
33713377 self . session . struct_span_err ( binding. span , & msg)
0 commit comments