Skip to content
Myr

Merge pull request #268 from dtolnay/provide

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Include outer backtrace when called as source.provide

authored by David Tolnay · committed by GitHub · parents 4b8df91, b30f5c5 · Browse files · 1 file+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:src/error.rs+11 added
520 unmodified lines
521522 Some(addr.cast::<E>().deref_mut())523 }524 }525526 // Called by thiserror when you have `#[source] anyhow::Error`. This provide527 // implementation includes the anyhow::Error's Backtrace if any, unlike528 // deref'ing to dyn Error where the provide implementation would include529 // only the original error's Backtrace from before it got wrapped into an530 // anyhow::Error.531 #[cfg(backtrace)]532 #[doc(hidden)]533 pub fn provide<'a>(&'a self, demand: &mut Demand<'a>) {534 unsafe { ErrorImpl::provide(self.inner.by_ref(), demand) }535 }536}537538#[cfg(feature = "std")]539#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
452 unmodified lines