diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-08-09 20:37:32 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-08-14 18:11:56 +0200 |
| commit | 744d39ebe61ad8cc674797793c743493af078d74 (patch) | |
| tree | f2c8fbde192c4d2a80c84d03713aeffef039b9b4 /compiler/rustc_hir/src/lints.rs | |
| parent | e7ef23e90e5b63e86bd77061ab92b86190a4eb3c (diff) | |
| download | rust-744d39ebe61ad8cc674797793c743493af078d74.tar.gz rust-744d39ebe61ad8cc674797793c743493af078d74.zip | |
Allow attribute parsers to specify a list of allowed targets
Every acceptor gets an `ALLOWED_TARGETS` specification which can specify per target whether it is allowed, warned, or errored.
Diffstat (limited to 'compiler/rustc_hir/src/lints.rs')
| -rw-r--r-- | compiler/rustc_hir/src/lints.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_hir/src/lints.rs b/compiler/rustc_hir/src/lints.rs index c55a41eb2b7..e3cde2d3bb6 100644 --- a/compiler/rustc_hir/src/lints.rs +++ b/compiler/rustc_hir/src/lints.rs @@ -1,8 +1,8 @@ use rustc_data_structures::fingerprint::Fingerprint; use rustc_macros::HashStable_Generic; -use rustc_span::Span; +use rustc_span::{Span, Symbol}; -use crate::HirId; +use crate::{HirId, Target}; #[derive(Debug)] pub struct DelayedLints { @@ -34,4 +34,5 @@ pub enum AttributeLintKind { UnusedDuplicate { this: Span, other: Span, warning: bool }, IllFormedAttributeInput { suggestions: Vec<String> }, EmptyAttribute { first_span: Span }, + InvalidTarget { name: Symbol, target: Target, applied: String, only: &'static str }, } |
