[−][src]Trait macro_compose::Lint
Lint is used for linting the macro input
Example
use macro_compose::{Collector, Lint}; use syn::{Data, DeriveInput, Error}; struct EnsureStructLint; impl Lint<DeriveInput> for EnsureStructLint { fn lint(&self, input: &DeriveInput, c: &mut Collector) { if !matches!(&input.data, Data::Struct(_)) { c.error(Error::new_spanned(input, "expected a struct")); } } }