@@ -287,6 +287,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
287
287
ribs : & [ Rib < ' ra > ] ,
288
288
ignore_binding : Option < NameBinding < ' ra > > ,
289
289
) -> ResolveIdentInBlockRes < ' ra > {
290
+ let mut original_ident = * ident;
291
+
290
292
fn resolve_ident_in_forward_macro_of_block < ' ra > (
291
293
r : & mut Resolver < ' ra , ' _ > ,
292
294
expansion : & mut Option < NodeId > , // macro_def_id
@@ -410,20 +412,28 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
410
412
return ResolveIdentInBlockRes :: DefinedLater { def_site } ;
411
413
}
412
414
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 (
415
425
ModuleOrUniformRoot :: Module ( module) ,
416
- * ident ,
426
+ original_ident ,
417
427
ns,
418
428
parent_scope,
419
429
Shadowing :: Unrestricted ,
420
430
finalize. map ( |finalize| Finalize { used : Used :: Scope , ..finalize } ) ,
421
431
ignore_binding,
422
432
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
+ }
427
437
}
428
438
429
439
ResolveIdentInBlockRes :: NotFound
0 commit comments