@@ -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)
@@ -252,6 +268,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
252
268
| AttributeKind :: ConstStabilityIndirect
253
269
| AttributeKind :: MacroTransparency ( _)
254
270
| AttributeKind :: Dummy
271
+ | AttributeKind :: RustcBuiltinMacro { .. }
255
272
| AttributeKind :: OmitGdbPrettyPrinterSection ,
256
273
) => { /* do nothing */ }
257
274
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
@@ -351,16 +368,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
351
368
[ sym:: should_panic, ..] => {
352
369
self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn )
353
370
}
354
- [ sym:: proc_macro, ..] => {
355
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
356
- }
357
- [ sym:: proc_macro_attribute, ..] => {
358
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
359
- }
360
- [ sym:: proc_macro_derive, ..] => {
361
- self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn ) ;
362
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
363
- }
364
371
[ sym:: autodiff_forward, ..] | [ sym:: autodiff_reverse, ..] => {
365
372
self . check_autodiff ( hir_id, attr, span, target)
366
373
}
0 commit comments