@@ -130,6 +130,22 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
130
130
for attr in attrs {
131
131
let mut style = None ;
132
132
match attr {
133
+ Attribute :: Parsed ( AttributeKind :: ProcMacro ( _) ) => {
134
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
135
+ }
136
+ Attribute :: Parsed ( AttributeKind :: ProcMacroAttribute ( _) ) => {
137
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
138
+ }
139
+ Attribute :: Parsed ( AttributeKind :: ProcMacroDerive { span : attr_span, .. } ) => {
140
+ self . check_generic_attr (
141
+ hir_id,
142
+ sym:: proc_macro_derive,
143
+ * attr_span,
144
+ target,
145
+ Target :: Fn ,
146
+ ) ;
147
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
148
+ }
133
149
Attribute :: Parsed (
134
150
AttributeKind :: SkipDuringMethodDispatch { span : attr_span, .. }
135
151
| AttributeKind :: Coinductive ( attr_span)
@@ -275,6 +291,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
275
291
| AttributeKind :: MacroTransparency ( _)
276
292
| AttributeKind :: Pointee ( ..)
277
293
| AttributeKind :: Dummy
294
+ | AttributeKind :: RustcBuiltinMacro { .. }
278
295
| AttributeKind :: OmitGdbPrettyPrinterSection ,
279
296
) => { /* do nothing */ }
280
297
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
@@ -373,16 +390,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
373
390
[ sym:: should_panic, ..] => {
374
391
self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn )
375
392
}
376
- [ sym:: proc_macro, ..] => {
377
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
378
- }
379
- [ sym:: proc_macro_attribute, ..] => {
380
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
381
- }
382
- [ sym:: proc_macro_derive, ..] => {
383
- self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn ) ;
384
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
385
- }
386
393
[ sym:: autodiff_forward, ..] | [ sym:: autodiff_reverse, ..] => {
387
394
self . check_autodiff ( hir_id, attr, span, target)
388
395
}
0 commit comments