blob: 23eda1a0355e28d4e0ad3d6b32e9fd35d9cb18ce [file]
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_error_messages::MultiSpan;
use rustc_lint_defs::LintId;
pub use rustc_lint_defs::{AttributeLintKind, FormatWarning};
use rustc_macros::HashStable_Generic;
use crate::HirId;
#[derive(Debug)]
pub struct DelayedLints {
pub lints: Box<[DelayedLint]>,
// Only present when the crate hash is needed.
pub opt_hash: Option<Fingerprint>,
}
/// During ast lowering, no lints can be emitted.
/// That is because lints attach to nodes either in the AST, or on the built HIR.
/// When attached to AST nodes, they're emitted just before building HIR,
/// and then there's a gap where no lints can be emitted until HIR is done.
/// The variants in this enum represent lints that are temporarily stashed during
/// AST lowering to be emitted once HIR is built.
#[derive(Debug, HashStable_Generic)]
pub enum DelayedLint {
AttributeParsing(AttributeLint<HirId>),
}
#[derive(Debug, HashStable_Generic)]
pub struct AttributeLint<Id> {
pub lint_id: LintId,
pub id: Id,
pub span: MultiSpan,
pub kind: AttributeLintKind,
}