@@ -132,7 +132,22 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
132
132
target,
133
133
attrs,
134
134
) ,
135
- _ => {
135
+ Attribute :: Parsed ( AttributeKind :: AllowConstFnUnstable { .. } ) => {
136
+ self . check_rustc_allow_const_fn_unstable ( hir_id, attr, span, target)
137
+ }
138
+ Attribute :: Parsed ( AttributeKind :: Deprecation { .. } ) => {
139
+ self . check_deprecated ( hir_id, attr, span, target)
140
+ }
141
+ Attribute :: Parsed ( AttributeKind :: DocComment { .. } ) => { /* `#[doc]` is actually a lot more than just doc comments, so is checked below*/
142
+ }
143
+ Attribute :: Parsed ( AttributeKind :: Repr ( _) ) => { /* handled below this loop and elsewhere */
144
+ }
145
+ Attribute :: Parsed (
146
+ AttributeKind :: BodyStability { .. }
147
+ | AttributeKind :: ConstStabilityIndirect
148
+ | AttributeKind :: MacroTransparency ( _) ,
149
+ ) => { /* do nothing */ }
150
+ Attribute :: Unparsed ( _) => {
136
151
match attr. path ( ) . as_slice ( ) {
137
152
[ sym:: diagnostic, sym:: do_not_recommend, ..] => {
138
153
self . check_do_not_recommend ( attr. span ( ) , hir_id, target, attr, item)
@@ -169,9 +184,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
169
184
self . check_rustc_layout_scalar_valid_range ( attr, span, target)
170
185
}
171
186
[ sym:: debugger_visualizer, ..] => self . check_debugger_visualizer ( attr, target) ,
172
- [ sym:: rustc_allow_const_fn_unstable, ..] => {
173
- self . check_rustc_allow_const_fn_unstable ( hir_id, attr, span, target)
174
- }
175
187
[ sym:: rustc_std_internal_symbol, ..] => {
176
188
self . check_rustc_std_internal_symbol ( attr, span, target)
177
189
}
@@ -226,7 +238,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
226
238
[ sym:: link_name, ..] => self . check_link_name ( hir_id, attr, span, target) ,
227
239
[ sym:: link_section, ..] => self . check_link_section ( hir_id, attr, span, target) ,
228
240
[ sym:: no_mangle, ..] => self . check_no_mangle ( hir_id, attr, span, target) ,
229
- [ sym:: deprecated, ..] => self . check_deprecated ( hir_id, attr, span, target) ,
230
241
[ sym:: macro_use, ..] | [ sym:: macro_escape, ..] => {
231
242
self . check_macro_use ( hir_id, attr, target)
232
243
}
@@ -279,7 +290,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
279
290
| sym:: pointee // FIXME(derive_coerce_pointee)
280
291
| sym:: omit_gdb_pretty_printer_section // FIXME(omit_gdb_pretty_printer_section)
281
292
| sym:: used // handled elsewhere to restrict to static items
282
- | sym:: repr // handled elsewhere to restrict to type decls items
283
293
| sym:: instruction_set // broken on stable!!!
284
294
| sym:: windows_subsystem // broken on stable!!!
285
295
| sym:: patchable_function_entry // FIXME(patchable_function_entry)
0 commit comments