We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b986c86 commit 8f92490Copy full SHA for 8f92490
src/error.rs
@@ -71,8 +71,13 @@ impl Error {
71
///
72
/// [tracking]: https://github.com/rust-lang/rust/issues/53487
73
#[cfg(backtrace)]
74
- pub fn backtrace(&self) -> &std::backtrace::Backtrace {
75
- self.error.backtrace()
+ pub fn backtrace(&self) -> Option<&std::backtrace::Backtrace> {
+ Some(self.error.backtrace())
76
+ }
77
+
78
+ #[cfg(not(backtrace))]
79
+ pub fn backtrace(&self) -> Option<()> {
80
+ None
81
}
82
83
/// Attempt to downcast the error object to a concrete type.
0 commit comments