@@ -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 })
@@ -159,10 +151,6 @@ pub trait Error: Debug + Display {
159151 /// }
160152 ///
161153 /// impl Error for SuperError {
162- /// fn description(&self) -> &str {
163- /// "I'm the superhero of errors"
164- /// }
165- ///
166154 /// fn source(&self) -> Option<&(dyn Error + 'static)> {
167155 /// Some(&self.side)
168156 /// }
@@ -177,11 +165,7 @@ pub trait Error: Debug + Display {
177165 /// }
178166 /// }
179167 ///
180- /// impl Error for SuperErrorSideKick {
181- /// fn description(&self) -> &str {
182- /// "I'm SuperError side kick"
183- /// }
184- /// }
168+ /// impl Error for SuperErrorSideKick {}
185169 ///
186170 /// fn get_super_error() -> Result<(), SuperError> {
187171 /// Err(SuperError { side: SuperErrorSideKick })
@@ -261,11 +245,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
261245 /// }
262246 /// }
263247 ///
264- /// impl Error for AnError {
265- /// fn description(&self) -> &str {
266- /// "Description of an error"
267- /// }
268- /// }
248+ /// impl Error for AnError {}
269249 ///
270250 /// let an_error = AnError;
271251 /// assert!(0 == mem::size_of_val(&an_error));
@@ -300,11 +280,7 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
300280 /// }
301281 /// }
302282 ///
303- /// impl Error for AnError {
304- /// fn description(&self) -> &str {
305- /// "Description of an error"
306- /// }
307- /// }
283+ /// impl Error for AnError {}
308284 ///
309285 /// unsafe impl Send for AnError {}
310286 ///
0 commit comments