1use rustc_data_structures::fingerprint::Fingerprint;
2use rustc_macros::HashStable_Generic;
3use rustc_span::Span;
4
5use crate::{AttrPath, HirId, Target};
6
7#[derive(Debug)]
8pub struct DelayedLints {
9 pub lints: Box<[DelayedLint]>,
10 pub opt_hash: Option<Fingerprint>,
12}
13
14#[derive(Clone, Debug, HashStable_Generic)]
21pub enum DelayedLint {
22 AttributeParsing(AttributeLint<HirId>),
23}
24
25#[derive(Clone, Debug, HashStable_Generic)]
26pub struct AttributeLint<Id> {
27 pub id: Id,
28 pub span: Span,
29 pub kind: AttributeLintKind,
30}
31
32#[derive(Clone, Debug, HashStable_Generic)]
33pub enum AttributeLintKind {
34 UnusedDuplicate {
35 this: Span,
36 other: Span,
37 warning: bool,
38 },
39 IllFormedAttributeInput {
40 suggestions: Vec<String>,
41 },
42 EmptyAttribute {
43 first_span: Span,
44 },
45
46 InvalidMacroExportArguments {
50 suggestions: Vec<String>,
51 },
52 InvalidTarget {
53 name: AttrPath,
54 target: Target,
55 applied: Vec<String>,
56 only: &'static str,
57 },
58 InvalidStyle {
59 name: AttrPath,
60 is_used_as_inner: bool,
61 target: Target,
62 target_span: Span,
63 },
64}