@@ -120,6 +120,22 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
120
120
for attr in attrs {
121
121
let mut style = None ;
122
122
match attr {
123
+ Attribute :: Parsed ( AttributeKind :: ProcMacro ( _) ) => {
124
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
125
+ }
126
+ Attribute :: Parsed ( AttributeKind :: ProcMacroAttribute ( _) ) => {
127
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
128
+ }
129
+ Attribute :: Parsed ( AttributeKind :: ProcMacroDerive { span : attr_span, .. } ) => {
130
+ self . check_generic_attr (
131
+ hir_id,
132
+ sym:: proc_macro_derive,
133
+ * attr_span,
134
+ target,
135
+ Target :: Fn ,
136
+ ) ;
137
+ self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
138
+ }
123
139
Attribute :: Parsed ( AttributeKind :: SkipDuringMethodDispatch {
124
140
span : attr_span,
125
141
..
@@ -217,7 +233,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
217
233
AttributeKind :: BodyStability { .. }
218
234
| AttributeKind :: ConstStabilityIndirect
219
235
| AttributeKind :: MacroTransparency ( _)
220
- | AttributeKind :: Dummy ,
236
+ | AttributeKind :: Dummy
237
+ | AttributeKind :: RustcBuiltinMacro { .. } ,
221
238
) => { /* do nothing */ }
222
239
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
223
240
self . check_applied_to_fn_or_method ( hir_id, * attr_span, span, target)
@@ -323,16 +340,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
323
340
[ sym:: automatically_derived, ..] => {
324
341
self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Impl )
325
342
}
326
- [ sym:: proc_macro, ..] => {
327
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
328
- }
329
- [ sym:: proc_macro_attribute, ..] => {
330
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
331
- }
332
- [ sym:: proc_macro_derive, ..] => {
333
- self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn ) ;
334
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
335
- }
336
343
[ sym:: autodiff_forward, ..] | [ sym:: autodiff_reverse, ..] => {
337
344
self . check_autodiff ( hir_id, attr, span, target)
338
345
}
0 commit comments