1#![allow(
2 clippy::blocks_in_conditions,
3 clippy::cast_lossless,
4 clippy::cast_possible_truncation,
5 clippy::manual_find,
6 clippy::manual_let_else,
7 clippy::manual_map,
8 clippy::map_unwrap_or,
9 clippy::module_name_repetitions,
10 clippy::needless_pass_by_value,
11 clippy::range_plus_one,
12 clippy::single_match_else,
13 clippy::struct_field_names,
14 clippy::too_many_lines,
15 clippy::wrong_self_convention
16)]
17
18extern crate proc_macro;
19
20mod ast;
21mod attr;
22mod expand;
23mod fmt;
24mod generics;
25mod prop;
26mod span;
27mod valid;
28
29use proc_macro::TokenStream;
30use syn::{parse_macro_input, DeriveInput};
31
32#[proc_macro_derive(Error, attributes(backtrace, error, from, source))]
33pub fn derive_error(input: TokenStream) -> TokenStream {
34 let input: DeriveInput = parse_macro_input!(input as DeriveInput);
35 expand::derive(&input).into()
36}
37