Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Jul 11, 2022
1 parent e3839cc commit 655d6e8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions library/std/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ pub trait Error: Debug + Display {
/// }
/// ```
#[unstable(feature = "error_generic_member_access", issue = "none")]
fn provide<'a>(&'a self, _req: &mut Demand<'a>) {}
#[allow(unused_variables)]
fn provide<'a>(&'a self, req: &mut Demand<'a>) {}
}

#[unstable(feature = "error_generic_member_access", issue = "none")]
Expand Down Expand Up @@ -910,13 +911,13 @@ impl dyn Error + 'static {
}
}

/// Request a reference to context of type `T`.
/// Request a reference of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_ref<T: ?Sized + 'static>(&self) -> Option<&T> {
core::any::request_ref(self)
}

/// Request a value to context of type `T`.
/// Request a value of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_value<T: 'static>(&self) -> Option<T> {
core::any::request_value(self)
Expand Down Expand Up @@ -945,13 +946,13 @@ impl dyn Error + 'static + Send {
<dyn Error + 'static>::downcast_mut::<T>(self)
}

/// Request a reference to context of type `T`.
/// Request a reference of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_ref<T: ?Sized + 'static>(&self) -> Option<&T> {
<dyn Error + 'static>::request_ref(self)
}

/// Request a value to context of type `T`.
/// Request a value of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_value<T: 'static>(&self) -> Option<T> {
<dyn Error + 'static>::request_value(self)
Expand Down Expand Up @@ -980,13 +981,13 @@ impl dyn Error + 'static + Send + Sync {
<dyn Error + 'static>::downcast_mut::<T>(self)
}

/// Request a reference to context of type `T`.
/// Request a reference of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_ref<T: ?Sized + 'static>(&self) -> Option<&T> {
<dyn Error + 'static>::request_ref(self)
}

/// Request a value to context of type `T`.
/// Request a value of type `T` as context about this error.
#[unstable(feature = "error_generic_member_access", issue = "none")]
pub fn request_value<T: 'static>(&self) -> Option<T> {
<dyn Error + 'static>::request_value(self)
Expand Down

0 comments on commit 655d6e8

Please sign in to comment.