thiserror_impl/
lib.rs

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