@@ -287,6 +287,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
287287 ribs : & [ Rib < ' ra > ] ,
288288 ignore_binding : Option < NameBinding < ' ra > > ,
289289 ) -> ResolveIdentInBlockRes < ' ra > {
290+ let mut original_ident = * ident;
291+
290292 fn resolve_ident_in_forward_macro_of_block < ' ra > (
291293 r : & mut Resolver < ' ra , ' _ > ,
292294 expansion : & mut Option < NodeId > , // macro_def_id
@@ -410,20 +412,28 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
410412 return ResolveIdentInBlockRes :: DefinedLater { def_site } ;
411413 }
412414
413- if let Some ( module) = block_module
414- && let Ok ( binding) = self . cm ( ) . resolve_ident_in_module_unadjusted (
415+ if let Some ( module) = block_module {
416+ if let Some ( seen_macro_def_list) = self . seen_macro_def_in_block . get ( & resolving_block) {
417+ for m in seen_macro_def_list. iter ( ) . rev ( ) {
418+ if self . macro_def ( original_ident. span . ctxt ( ) ) == * m {
419+ original_ident. span . remove_mark ( ) ;
420+ }
421+ }
422+ }
423+
424+ if let Ok ( binding) = self . cm ( ) . resolve_ident_in_module_unadjusted (
415425 ModuleOrUniformRoot :: Module ( module) ,
416- * ident ,
426+ original_ident ,
417427 ns,
418428 parent_scope,
419429 Shadowing :: Unrestricted ,
420430 finalize. map ( |finalize| Finalize { used : Used :: Scope , ..finalize } ) ,
421431 ignore_binding,
422432 None ,
423- )
424- {
425- // The ident resolves to an item in a block.
426- return ResolveIdentInBlockRes :: Item ( binding ) ;
433+ ) {
434+ // The ident resolves to an item in a block.
435+ return ResolveIdentInBlockRes :: Item ( binding ) ;
436+ }
427437 }
428438
429439 ResolveIdentInBlockRes :: NotFound
0 commit comments