Fix documentation mentioning 'backtrace()' method

This commit is contained in:
David Tolnay 2022-09-27 14:34:19 -07:00
parent 7b226e33c7
commit c2759ce82e
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 10 additions and 7 deletions

View File

@ -124,8 +124,8 @@ pub enum DataStoreError {
}
```
- The Error trait's `backtrace()` method is implemented to return whichever
field has a type named `Backtrace`, if any.
- The Error trait's `provide()` method is implemented to provide whichever field
has a type named `Backtrace`, if any, as a `std::backtrace::Backtrace`.
```rust
use std::backtrace::Backtrace;
@ -138,8 +138,9 @@ pub enum DataStoreError {
```
- If a field is both a source (named `source`, or has `#[source]` or `#[from]`
attribute) *and* is marked `#[backtrace]`, then the Error trait's
`backtrace()` method is forwarded to the source's backtrace.
attribute) *and* is marked `#[backtrace]`, then the Error trait's `provide()`
method is forwarded to the source's `provide` so that both layers of the error
share the same backtrace.
```rust
#[derive(Error, Debug)]

View File

@ -146,8 +146,9 @@
//! # }
//! ```
//!
//! - The Error trait's `backtrace()` method is implemented to return whichever
//! field has a type named `Backtrace`, if any.
//! - The Error trait's `provide()` method is implemented to provide whichever
//! field has a type named `Backtrace`, if any, as a
//! `std::backtrace::Backtrace`.
//!
//! ```rust
//! # const IGNORE: &str = stringify! {
@ -163,7 +164,8 @@
//!
//! - If a field is both a source (named `source`, or has `#[source]` or
//! `#[from]` attribute) *and* is marked `#[backtrace]`, then the Error
//! trait's `backtrace()` method is forwarded to the source's backtrace.
//! trait's `provide()` method is forwarded to the source's `provide` so that
//! both layers of the error share the same backtrace.
//!
//! ```rust
//! # const IGNORE: &str = stringify! {