diff options
| author | Andy Russell <arussell123@gmail.com> | 2019-12-23 09:47:28 -0600 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2019-12-23 09:47:28 -0600 |
| commit | 24f3dcfdc741aaab0f1e56127455143912bc9203 (patch) | |
| tree | e472efb1c6d1a69af6e62159271b1e8db4718dbf | |
| parent | 01a46509a4c2dc430ebebf940a26232fdaeeba81 (diff) | |
| download | rust-24f3dcfdc741aaab0f1e56127455143912bc9203.tar.gz rust-24f3dcfdc741aaab0f1e56127455143912bc9203.zip | |
remove `description` from `Error` impls in docs
| -rw-r--r-- | src/libstd/error.rs | 32 | ||||
| -rw-r--r-- | src/libstd/io/error.rs | 4 |
2 files changed, 5 insertions, 31 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index d4c4cb9c3b9..f62c05c4441 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -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) /// } @@ -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 }) @@ -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) /// } @@ -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 }) @@ -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)); @@ -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 {} /// diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index c20bd3097b2..efe839d1302 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -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 { |
