@@ -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
..
@@ -207,7 +223,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
207
223
Attribute :: Parsed (
208
224
AttributeKind :: BodyStability { .. }
209
225
| AttributeKind :: ConstStabilityIndirect
210
- | AttributeKind :: MacroTransparency ( _) ,
226
+ | AttributeKind :: MacroTransparency ( _)
227
+ | AttributeKind :: RustcBuiltinMacro { .. } ,
211
228
) => { /* do nothing */ }
212
229
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
213
230
self . check_applied_to_fn_or_method ( hir_id, * attr_span, span, target)
@@ -315,16 +332,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
315
332
[ sym:: automatically_derived, ..] => {
316
333
self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Impl )
317
334
}
318
- [ sym:: proc_macro, ..] => {
319
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: FunctionLike )
320
- }
321
- [ sym:: proc_macro_attribute, ..] => {
322
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Attribute ) ;
323
- }
324
- [ sym:: proc_macro_derive, ..] => {
325
- self . check_generic_attr_unparsed ( hir_id, attr, target, Target :: Fn ) ;
326
- self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
327
- }
328
335
[ sym:: autodiff_forward, ..] | [ sym:: autodiff_reverse, ..] => {
329
336
self . check_autodiff ( hir_id, attr, span, target)
330
337
}
0 commit comments