@@ -77,7 +77,7 @@ use std::mem::replace;
77
77
use std:: rc:: Rc ;
78
78
79
79
use resolve_imports:: { ImportDirective , NameResolution } ;
80
- use macros:: { InvocationData , LegacyBinding , LegacyScope } ;
80
+ use macros:: { InvocationData , LegacyBinding } ;
81
81
82
82
// NB: This module needs to be declared first so diagnostics are
83
83
// registered before they are used.
@@ -1067,7 +1067,7 @@ pub struct Resolver<'a> {
1067
1067
1068
1068
privacy_errors : Vec < PrivacyError < ' a > > ,
1069
1069
ambiguity_errors : Vec < AmbiguityError < ' a > > ,
1070
- disallowed_shadowing : Vec < ( Name , Span , LegacyScope < ' a > ) > ,
1070
+ disallowed_shadowing : Vec < & ' a LegacyBinding < ' a > > ,
1071
1071
1072
1072
arenas : & ' a ResolverArenas < ' a > ,
1073
1073
dummy_binding : & ' a NameBinding < ' a > ,
@@ -3364,11 +3364,11 @@ impl<'a> Resolver<'a> {
3364
3364
3365
3365
fn report_shadowing_errors ( & mut self ) {
3366
3366
let mut reported_errors = FnvHashSet ( ) ;
3367
- for ( name , span , scope ) in replace ( & mut self . disallowed_shadowing , Vec :: new ( ) ) {
3368
- if self . resolve_macro_name ( scope , name, false ) . is_some ( ) &&
3369
- reported_errors. insert ( ( name, span) ) {
3370
- let msg = format ! ( "`{}` is already in scope" , name) ;
3371
- self . session . struct_span_err ( span, & msg)
3367
+ for binding in replace ( & mut self . disallowed_shadowing , Vec :: new ( ) ) {
3368
+ if self . resolve_macro_name ( binding . parent , binding . name , false ) . is_some ( ) &&
3369
+ reported_errors. insert ( ( binding . name , binding . span ) ) {
3370
+ let msg = format ! ( "`{}` is already in scope" , binding . name) ;
3371
+ self . session . struct_span_err ( binding . span , & msg)
3372
3372
. note ( "macro-expanded `macro_rules!`s may not shadow \
3373
3373
existing macros (see RFC 1560)")
3374
3374
. emit ( ) ;
0 commit comments