@@ -258,9 +258,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
258258 | AttributeKind :: RustcNoImplicitAutorefs
259259 | AttributeKind :: RustcLayoutScalarValidRangeStart ( ..)
260260 | AttributeKind :: RustcLayoutScalarValidRangeEnd ( ..)
261+ | AttributeKind :: RustcLintDiagnostics
261262 | AttributeKind :: RustcLintOptDenyFieldAccess { .. }
262263 | AttributeKind :: RustcLintOptTy
263264 | AttributeKind :: RustcLintQueryInstability
265+ | AttributeKind :: RustcLintUntrackedQueryInformation
264266 | AttributeKind :: RustcNeverReturnsNullPointer
265267 | AttributeKind :: RustcScalableVector { .. }
266268 | AttributeKind :: RustcSimdMonomorphizeLaneLimit ( ..)
@@ -309,12 +311,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
309311 self . check_diagnostic_on_const ( attr. span ( ) , hir_id, target, item)
310312 }
311313 [ sym:: thread_local, ..] => self . check_thread_local ( attr, span, target) ,
312- [ sym:: rustc_lint_untracked_query_information, ..] => {
313- self . check_applied_to_fn_or_method ( hir_id, attr. span ( ) , span, target)
314- }
315- [ sym:: rustc_lint_diagnostics, ..] => {
316- self . check_applied_to_fn_or_method ( hir_id, attr. span ( ) , span, target)
317- }
318314 [ sym:: rustc_clean, ..]
319315 | [ sym:: rustc_dirty, ..]
320316 | [ sym:: rustc_if_this_changed, ..]
@@ -1230,25 +1226,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
12301226 }
12311227 }
12321228
1233- /// Helper function for checking that the provided attribute is only applied to a function or
1234- /// method.
1235- fn check_applied_to_fn_or_method (
1236- & self ,
1237- hir_id : HirId ,
1238- attr_span : Span ,
1239- defn_span : Span ,
1240- target : Target ,
1241- ) {
1242- let is_function = matches ! ( target, Target :: Fn | Target :: Method ( ..) ) ;
1243- if !is_function {
1244- self . dcx ( ) . emit_err ( errors:: AttrShouldBeAppliedToFn {
1245- attr_span,
1246- defn_span,
1247- on_crate : hir_id == CRATE_HIR_ID ,
1248- } ) ;
1249- }
1250- }
1251-
12521229 /// Checks that the dep-graph debugging attributes are only present when the query-dep-graph
12531230 /// option is passed to the compiler.
12541231 fn check_rustc_dirty_clean ( & self , attr : & Attribute ) {
0 commit comments