1#[cfg(backtrace)]
2pub(crate) use std::backtrace::Backtrace;
3
4#[cfg(not(backtrace))]
5pub(crate) enum Backtrace {}
6
7#[cfg(backtrace)]
8macro_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))]
18macro_rules! backtrace_if_absent {
19 ($err:expr) => {
20 None
21 };
22}
23