1macro_rules! format_err {
2 ($obj:expr, $($format:tt)+) => {{
3 #[allow(unused_imports)]
4 use $crate::utils::error::*;
5 let msg = format!($($format)+);
6 $obj.EXPECTED_Span_OR_ToTokens(msg)
7 }};
8}
9
10macro_rules! abort {
11 ($obj:expr, $($format:tt)+) => {{
12 return Err(format_err!($obj, $($format)+));
13 }};
14}
15
16macro_rules! abort_call_site {
17 ($($format:tt)+) => {{
18 let span = proc_macro2::Span::call_site();
19 abort!(span, $($format)+)
20 }};
21}
22