const_panic_proc_macros/
lib.rs1#![no_std]
2
3extern crate alloc;
4
5#[cfg(test)]
6extern crate std;
7
8use proc_macro::TokenStream as TokenStream1;
9
10use proc_macro2::TokenStream as TokenStream2;
11
12mod datastructure;
13
14mod derive_debug;
15
16mod syntax;
17
18mod utils;
19
20#[cfg(test)]
21mod test_utils;
22
23#[proc_macro_derive(PanicFmt, attributes(pfmt))]
24pub fn derive_const_debug(input: TokenStream1) -> TokenStream1 {
25 syn::parse(input)
26 .and_then(derive_debug::derive_constdebug_impl)
27 .unwrap_or_else(|e| e.to_compile_error())
28 .into()
29}