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