1 | #[cfg(backtrace)] |
---|---|
2 | pub(crate) use std::backtrace::Backtrace; |
3 | |
4 | #[cfg(not(backtrace))] |
5 | pub(crate) enum Backtrace {} |
6 | |
7 | #[cfg(backtrace)] |
8 | macro_rules! backtrace_if_absent { |
9 | ($err:expr) => { |
10 | match $err.backtrace() { |
11 | Some(_) => None, |
12 | None => Some(Backtrace::capture()), |
13 | } |
14 | }; |
15 | } |
16 | |
17 | #[cfg(not(backtrace))] |
18 | macro_rules! backtrace_if_absent { |
19 | ($err:expr) => { |
20 | None |
21 | }; |
22 | } |
23 |