From 3d2b6a35cceb651fb9d0f57ab1c18d5844f400d0 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 20 Oct 2022 16:36:56 -0700 Subject: [PATCH 1/2] Remove redundant Backtrace provide_ref from ContextError --- src/context.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index c8bd4f0..76ac3a5 100644 --- a/src/context.rs +++ b/src/context.rs @@ -159,7 +159,6 @@ where #[cfg(backtrace)] fn provide<'a>(&'a self, demand: &mut Demand<'a>) { - demand.provide_ref(self.error.backtrace()); self.error.provide(demand); } } From 0b42fed789238a3dbd080d642a48458bebcfd02c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 20 Oct 2022 16:58:24 -0700 Subject: [PATCH 2/2] Call Provider::provide not Error::provide --- src/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context.rs b/src/context.rs index 76ac3a5..49af817 100644 --- a/src/context.rs +++ b/src/context.rs @@ -4,7 +4,7 @@ use core::convert::Infallible; use core::fmt::{self, Debug, Display, Write}; #[cfg(backtrace)] -use std::any::Demand; +use std::any::{Demand, Provider}; mod ext { use super::*; @@ -159,7 +159,7 @@ where #[cfg(backtrace)] fn provide<'a>(&'a self, demand: &mut Demand<'a>) { - self.error.provide(demand); + Provider::provide(&self.error, demand); } }