Rephrase nightly backtrace note
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Tolnay · committed by David Tolnay · parent 946bff8 · Browse files · 2 files·+12 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+12 added−13 removed
- other:+12 added−13 removed
Provenance
- Commit
e46df9f- Tree
d10691b- Author
David Tolnay <dtolnay@gmail.com>- Committer
David Tolnay <dtolnay@gmail.com>- Parent
946bff8
2 files changed+12 added−13 removed
modified:src/lib.rs+6 added-7 removed
118 unmodified lines119 //! }120 //! # ;121 //! ```122 //!123-//! - A backtrace is captured and printed with the error if the underlying error124-//! type does not already provide its own. In order to see backtraces, they125-//! must be enabled through the environment variables described in126-//! [`std::backtrace`]:123+//! - If using the nightly channel, a backtrace is captured and printed with the124+//! error if the underlying error type does not already provide its own. In125+//! order to see backtraces, they must be enabled through the environment126+//! variables described in [`std::backtrace`]:127 //!128 //! - If you want panics and errors to both have backtraces, set129 //! `RUST_BACKTRACE=1`;130 //! - If you want only errors to have backtraces, set `RUST_LIB_BACKTRACE=1`;131 //! - If you want only panics to have backtraces, set `RUST_BACKTRACE=1` and132 //! `RUST_LIB_BACKTRACE=0`.133 //!134-//! Backtraces are only available on the nightly channel. Tracking issue:135-//! [rust-lang/rust#53487][tracking].134+//! The tracking issue for this feature is [rust-lang/rust#53487].135 //!136 //! [`std::backtrace`]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables138-//! [tracking]: https://github.com/rust-lang/rust/issues/53487137+//! [rust-lang/rust#53487]: https://github.com/rust-lang/rust/issues/53487138 //!139 //! - Anyhow works with any error type that has an impl of `std::error::Error`,140 //! including ones defined in your crate. We do not bundle a `derive(Error)`141 //! macro but you can write the impls yourself or use a standalone macro like453 unmodified linesmodified:README.md+6 added-6 removed
72 unmodified lines737475767778797778798081828384858687878888899091919293949580 unmodified lines72 unmodified lines None => Err(error), } ```
- A backtrace is captured and printed with the error if the underlying error type does not already provide its own. In order to see backtraces, they must be enabled through the environment variables described in [`std::backtrace`]:- If using the nightly channel, a backtrace is captured and printed with the error if the underlying error type does not already provide its own. In order to see backtraces, they must be enabled through the environment variables described in [`std::backtrace`]:
- If you want panics and errors to both have backtraces, set `RUST_BACKTRACE=1`; - If you want only errors to have backtraces, set `RUST_LIB_BACKTRACE=1`; - If you want only panics to have backtraces, set `RUST_BACKTRACE=1` and `RUST_LIB_BACKTRACE=0`.
Backtraces are only available on the nightly channel. Tracking issue: [rust-lang/rust#53487][tracking]. The tracking issue for this feature is [rust-lang/rust#53487].
[`std::backtrace`]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables [tracking]: https://github.com/rust-lang/rust/issues/53487 [rust-lang/rust#53487]: https://github.com/rust-lang/rust/issues/53487
- Anyhow works with any error type that has an impl of `std::error::Error`, including ones defined in your crate. We do not bundle a `derive(Error)` macro but you can write the impls yourself or use a standalone macro like80 unmodified lines