diff --git a/src/backtrace.rs b/src/backtrace.rs index 01e33cb..81de6a7 100644 --- a/src/backtrace.rs +++ b/src/backtrace.rs @@ -7,7 +7,7 @@ pub(crate) enum Backtrace {} #[cfg(backtrace)] macro_rules! backtrace { () => { - Some(Backtrace::capture()) + Some(crate::backtrace::Backtrace::capture()) }; } @@ -23,7 +23,7 @@ macro_rules! backtrace_if_absent { ($err:expr) => { match $err.backtrace() { Some(_) => None, - None => Some(Backtrace::capture()), + None => backtrace!(), } }; } diff --git a/src/kind.rs b/src/kind.rs index fdeb060..eb8d604 100644 --- a/src/kind.rs +++ b/src/kind.rs @@ -50,9 +50,6 @@ use core::fmt::{Debug, Display}; #[cfg(feature = "std")] use crate::StdError; -#[cfg(backtrace)] -use std::backtrace::Backtrace; - pub struct Adhoc; pub trait AdhocKind: Sized { diff --git a/src/lib.rs b/src/lib.rs index a3126b6..061f703 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -613,9 +613,6 @@ pub mod private { use crate::Error; use core::fmt::{Debug, Display}; - #[cfg(backtrace)] - use std::backtrace::Backtrace; - pub use core::result::Result::Err; #[doc(hidden)]