Skip to content

Commit 6a263e1

Browse files
committed
explains that Error::backtrace can always be called
1 parent fee1f4b commit 6a263e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/error.rs

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ impl Error {
8484
/// capturing them all over the place all the time.
8585
///
8686
/// [tracking]: https://github.com/rust-lang/rust/issues/53487
87+
///
88+
/// Note: This function can be called whether or not backtraces
89+
/// are enabled and available. It will return a `None` variant if
90+
/// compiled on a toolchain that does not support backtraces, or
91+
/// if executed without backtraces enabled with
92+
/// `RUST_LIB_BACKTRACE=1`.
8793
#[cfg(backtrace)]
8894
pub fn backtrace(&self) -> Option<&std::backtrace::Backtrace> {
8995
let backtrace = self.error.backtrace();

0 commit comments

Comments
 (0)