@@ -990,6 +990,9 @@ pub struct Resolver<'a> {
990990 crate_loader : CrateLoader < ' a > ,
991991 macro_names : FxHashSet < Ident > ,
992992 builtin_macros : FxHashMap < Symbol , BuiltinMacroState > ,
993+ /// A small map keeping true kinds of built-in macros that appear to be fn-like on
994+ /// the surface (`macro` items in libcore), but are actually attributes or derives.
995+ builtin_macro_kinds : FxHashMap < LocalDefId , MacroKind > ,
993996 registered_attrs : FxHashSet < Ident > ,
994997 registered_tools : RegisteredTools ,
995998 macro_use_prelude : FxHashMap < Symbol , & ' a NameBinding < ' a > > ,
@@ -1261,6 +1264,10 @@ impl ResolverAstLowering for Resolver<'_> {
12611264
12621265 def_id
12631266 }
1267+
1268+ fn decl_macro_kind ( & self , def_id : LocalDefId ) -> MacroKind {
1269+ self . builtin_macro_kinds . get ( & def_id) . copied ( ) . unwrap_or ( MacroKind :: Bang )
1270+ }
12641271}
12651272
12661273impl < ' a > Resolver < ' a > {
@@ -1381,6 +1388,7 @@ impl<'a> Resolver<'a> {
13811388 crate_loader : CrateLoader :: new ( session, metadata_loader, crate_name) ,
13821389 macro_names : FxHashSet :: default ( ) ,
13831390 builtin_macros : Default :: default ( ) ,
1391+ builtin_macro_kinds : Default :: default ( ) ,
13841392 registered_attrs,
13851393 registered_tools,
13861394 macro_use_prelude : FxHashMap :: default ( ) ,
0 commit comments