rustc_hir/lints.rs
1use rustc_attr_data_structures::lints::AttributeLint;
2use rustc_data_structures::fingerprint::Fingerprint;
3use rustc_macros::HashStable_Generic;
4
5use crate::HirId;
6
7/// During ast lowering, no lints can be emitted.
8/// That is because lints attach to nodes either in the AST, or on the built HIR.
9/// When attached to AST nodes, they're emitted just before building HIR,
10/// and then there's a gap where no lints can be emitted until HIR is done.
11/// The variants in this enum represent lints that are temporarily stashed during
12/// AST lowering to be emitted once HIR is built.
13#[derive(Clone, Debug, HashStable_Generic)]
14pub enum DelayedLint {
15 AttributeParsing(AttributeLint<HirId>),
16}
17
18#[derive(Debug)]
19pub struct DelayedLints {
20 pub lints: Box<[DelayedLint]>,
21 // Only present when the crate hash is needed.
22 pub opt_hash: Option<Fingerprint>,
23}