Skip to content

Commit 24f3dcf

Browse files
committed
remove description from Error impls in docs
1 parent 01a4650 commit 24f3dcf

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

src/libstd/error.rs

+4-28
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ pub trait Error: Debug + Display {
9191
/// }
9292
///
9393
/// impl Error for SuperError {
94-
/// fn description(&self) -> &str {
95-
/// "I'm the superhero of errors"
96-
/// }
97-
///
9894
/// fn cause(&self) -> Option<&dyn Error> {
9995
/// Some(&self.side)
10096
/// }
@@ -109,11 +105,7 @@ pub trait Error: Debug + Display {
109105
/// }
110106
/// }
111107
///
112-
/// impl Error for SuperErrorSideKick {
113-
/// fn description(&self) -> &str {
114-
/// "I'm SuperError side kick"
115-
/// }
116-
/// }
108+
/// impl Error for SuperErrorSideKick {}
117109
///
118110
/// fn get_super_error() -> Result<(), SuperError> {
119111
/// Err(SuperError { side: SuperErrorSideKick })
@@ -156,10 +148,6 @@ pub trait Error: Debug + Display {
156148
/// }
157149
///
158150
/// impl Error for SuperError {
159-
/// fn description(&self) -> &str {
160-
/// "I'm the superhero of errors"
161-
/// }
162-
///
163151
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
164152
/// Some(&self.side)
165153
/// }
@@ -174,11 +162,7 @@ pub trait Error: Debug + Display {
174162
/// }
175163
/// }
176164
///
177-
/// impl Error for SuperErrorSideKick {
178-
/// fn description(&self) -> &str {
179-
/// "I'm SuperError side kick"
180-
/// }
181-
/// }
165+
/// impl Error for SuperErrorSideKick {}
182166
///
183167
/// fn get_super_error() -> Result<(), SuperError> {
184168
/// Err(SuperError { side: SuperErrorSideKick })
@@ -251,11 +235,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
251235
/// }
252236
/// }
253237
///
254-
/// impl Error for AnError {
255-
/// fn description(&self) -> &str {
256-
/// "Description of an error"
257-
/// }
258-
/// }
238+
/// impl Error for AnError {}
259239
///
260240
/// let an_error = AnError;
261241
/// 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 +
290270
/// }
291271
/// }
292272
///
293-
/// impl Error for AnError {
294-
/// fn description(&self) -> &str {
295-
/// "Description of an error"
296-
/// }
297-
/// }
273+
/// impl Error for AnError {}
298274
///
299275
/// unsafe impl Send for AnError {}
300276
///

src/libstd/io/error.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ impl Error {
402402
/// }
403403
/// }
404404
///
405-
/// impl error::Error for MyError {
406-
/// fn description(&self) -> &str { &self.v }
407-
/// }
405+
/// impl error::Error for MyError {}
408406
///
409407
/// impl Display for MyError {
410408
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)