1use rustc_data_structures::sync::{DynSend, DynSync};
2use rustc_error_messages::MultiSpan;
3use rustc_errors::{Diag, DiagCtxtHandle, Level};
4use rustc_hir_id::HirId;
5use rustc_lint_defs::LintId;
6
7pub type DelayedLints = Box<[DelayedLint]>;
8
9pub struct DelayedLint {
16 pub lint_id: LintId,
17 pub id: HirId,
18 pub span: MultiSpan,
19 pub callback: Box<
20 dyn for<'a> FnOnce(DiagCtxtHandle<'a>, Level, &dyn std::any::Any) -> Diag<'a, ()>
21 + DynSend
22 + DynSync
23 + 'static,
24 >,
25}
26
27impl std::fmt::Debug for DelayedLint {
28 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 f.debug_struct("DelayedLint")
30 .field("lint_id", &self.lint_id)
31 .field("id", &self.id)
32 .field("span", &self.span)
33 .finish()
34 }
35}