diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index bfdb7a92beff6..8d6e0e730e6fb 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2966,7 +2966,7 @@ impl core::error::Error for Arc { core::error::Error::source(&**self) } - fn provide<'a>(&'a self, req: &mut core::any::Demand<'a>) { - core::error::Error::provide(&**self, req); + fn provide_context<'a>(&'a self, req: &mut core::any::Demand<'a>) { + core::error::Error::provide_context(&**self, req); } } diff --git a/library/core/src/error.rs b/library/core/src/error.rs index 11cb082757864..7140b6711a9a9 100644 --- a/library/core/src/error.rs +++ b/library/core/src/error.rs @@ -172,7 +172,7 @@ pub trait Error: Debug + Display { /// } /// /// impl std::error::Error for Error { - /// fn provide<'a>(&'a self, demand: &mut Demand<'a>) { + /// fn provide_context<'a>(&'a self, demand: &mut Demand<'a>) { /// demand /// .provide_ref::(&self.backtrace) /// .provide_ref::(&self.source); @@ -191,7 +191,7 @@ pub trait Error: Debug + Display { /// ``` #[unstable(feature = "error_generic_member_access", issue = "99301")] #[allow(unused_variables)] - fn provide<'a>(&'a self, demand: &mut Demand<'a>) {} + fn provide_context<'a>(&'a self, demand: &mut Demand<'a>) {} } #[unstable(feature = "error_generic_member_access", issue = "99301")] @@ -200,7 +200,7 @@ where E: Error + ?Sized, { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { - self.provide(demand) + self.provide_context(demand) } } @@ -449,8 +449,8 @@ impl<'a, T: Error + ?Sized> Error for &'a T { Error::source(&**self) } - fn provide<'b>(&'b self, demand: &mut Demand<'b>) { - Error::provide(&**self, demand); + fn provide_context<'b>(&'b self, demand: &mut Demand<'b>) { + Error::provide_context(&**self, demand); } } diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 05f8fd8de327f..fa1c32bf9611f 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -404,7 +404,7 @@ impl Report { /// } /// /// impl Error for SuperErrorSideKick { - /// fn provide<'a>(&'a self, demand: &mut Demand<'a>) { + /// fn provide_context<'a>(&'a self, demand: &mut Demand<'a>) { /// demand.provide_ref::(&self.backtrace); /// } /// } diff --git a/library/std/src/error/tests.rs b/library/std/src/error/tests.rs index ee999bd65c3c9..27fa0cc53d595 100644 --- a/library/std/src/error/tests.rs +++ b/library/std/src/error/tests.rs @@ -199,7 +199,7 @@ where self.source.as_deref() } - fn provide<'a>(&'a self, req: &mut Demand<'a>) { + fn provide_context<'a>(&'a self, req: &mut Demand<'a>) { self.backtrace.as_ref().map(|bt| req.provide_ref::(bt)); } }