Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove description from Error impls in docs #67561

Merged
merged 1 commit into from
Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions src/libstd/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ pub trait Error: Debug + Display {
/// }
///
/// impl Error for SuperError {
/// fn description(&self) -> &str {
/// "I'm the superhero of errors"
/// }
///
/// fn cause(&self) -> Option<&dyn Error> {
/// Some(&self.side)
/// }
Expand All @@ -109,11 +105,7 @@ pub trait Error: Debug + Display {
/// }
/// }
///
/// impl Error for SuperErrorSideKick {
/// fn description(&self) -> &str {
/// "I'm SuperError side kick"
/// }
/// }
/// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
Expand Down Expand Up @@ -156,10 +148,6 @@ pub trait Error: Debug + Display {
/// }
///
/// impl Error for SuperError {
/// fn description(&self) -> &str {
/// "I'm the superhero of errors"
/// }
///
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
/// Some(&self.side)
/// }
Expand All @@ -174,11 +162,7 @@ pub trait Error: Debug + Display {
/// }
/// }
///
/// impl Error for SuperErrorSideKick {
/// fn description(&self) -> &str {
/// "I'm SuperError side kick"
/// }
/// }
/// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
Expand Down Expand Up @@ -251,11 +235,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
/// }
/// }
///
/// impl Error for AnError {
/// fn description(&self) -> &str {
/// "Description of an error"
/// }
/// }
/// impl Error for AnError {}
///
/// let an_error = AnError;
/// assert!(0 == mem::size_of_val(&an_error));
Expand Down Expand Up @@ -290,11 +270,7 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
/// }
/// }
///
/// impl Error for AnError {
/// fn description(&self) -> &str {
/// "Description of an error"
/// }
/// }
/// impl Error for AnError {}
///
/// unsafe impl Send for AnError {}
///
Expand Down
4 changes: 1 addition & 3 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,7 @@ impl Error {
/// }
/// }
///
/// impl error::Error for MyError {
/// fn description(&self) -> &str { &self.v }
/// }
/// impl error::Error for MyError {}
///
/// impl Display for MyError {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down