Skip to content
Myr

impl std::any::Provider for anyhow::Error

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 916e22b · Browse files · 1 file+4 added−3 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+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:src/error.rs+4 added-3 removed
520 unmodified lines
521522 Some(addr.cast::<E>().deref_mut())523 }524 }525}526527#[cfg(backtrace)]528impl std::any::Provider for Error {529 // Called by thiserror when you have `#[source] anyhow::Error`. This provide530 // implementation includes the anyhow::Error's Backtrace if any, unlike531 // deref'ing to dyn Error where the provide implementation would include532 // only the original error's Backtrace from before it got wrapped into an533 // anyhow::Error.531 #[cfg(backtrace)]532 #[doc(hidden)]533 pub fn provide<'a>(&'a self, demand: &mut Demand<'a>) {534 fn provide<'a>(&'a self, demand: &mut Demand<'a>) {535 unsafe { ErrorImpl::provide(self.inner.by_ref(), demand) }536 }537}538
454 unmodified lines