@@ -123,6 +123,22 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
123
123
for attr in attrs {
124
124
let mut style = None ;
125
125
match attr {
126
+ Attribute :: Parsed ( AttributeKind :: ProcMacro ( _) ) => {
127
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
128
+ }
129
+ Attribute :: Parsed ( AttributeKind :: ProcMacroAttribute ( _) ) => {
130
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
131
+ }
132
+ Attribute :: Parsed ( AttributeKind :: ProcMacroDerive { span : attr_span, .. } ) => {
133
+ self . check_generic_attr (
134
+ hir_id,
135
+ sym:: proc_macro_derive,
136
+ * attr_span,
137
+ target,
138
+ Target :: Fn ,
139
+ ) ;
140
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
141
+ }
126
142
Attribute :: Parsed (
127
143
AttributeKind :: SkipDuringMethodDispatch { span : attr_span, .. }
128
144
| AttributeKind :: Coinductive ( attr_span)
@@ -253,6 +269,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
253
269
| AttributeKind :: MacroTransparency ( _)
254
270
| AttributeKind :: Pointee ( ..)
255
271
| AttributeKind :: Dummy
272
+ | AttributeKind :: RustcBuiltinMacro { .. }
256
273
| AttributeKind :: OmitGdbPrettyPrinterSection ,
257
274
) => { /* do nothing */ }
258
275
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
@@ -352,16 +369,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
352
369
[ sym:: should_panic, ..] => {
353
370
self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn )
354
371
}
355
- [ sym:: proc_macro, ..] => {
356
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
357
- }
358
- [ sym:: proc_macro_attribute, ..] => {
359
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
360
- }
361
- [ sym:: proc_macro_derive, ..] => {
362
- self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn ) ;
363
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
364
- }
365
372
[ sym:: autodiff_forward, ..] | [ sym:: autodiff_reverse, ..] => {
366
373
self . check_autodiff ( hir_id, attr, span, target)
367
374
}
0 commit comments