| 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 |
|
| 18 |
extern crate proc_macro; |
| 19 |
|
| 20 |
mod ast; |
| 21 |
mod attr; |
| 22 |
mod expand; |
| 23 |
mod fmt; |
| 24 |
mod generics; |
| 25 |
mod prop; |
| 26 |
mod span; |
| 27 |
mod valid; |
| 28 |
|
| 29 |
use proc_macro::TokenStream; |
| 30 |
use syn::{parse_macro_input, DeriveInput}; |
| 31 |
|
| 32 |
#[proc_macro_derive(Error, attributes(backtrace, error, from, source))] |
| 33 |
pub fn derive_error(input: TokenStream) -> TokenStream { |
| 34 |
let input = parse_macro_input!(input as DeriveInput); |
| 35 |
expand::derive(&input).into() |
| 36 |
} |