Rollup merge of #67561 - euclio:remove-description, r=jonas-schievink
remove `description` from `Error` impls in docs Since `description` is soft-deprecated, there's no need to show it implemented in these examples.
This commit is contained in:
commit
75b27ef59c
2 changed files with 5 additions and 31 deletions
|
@ -91,10 +91,6 @@ pub trait Error: Debug + Display {
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for SuperError {
|
/// impl Error for SuperError {
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "I'm the superhero of errors"
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// fn cause(&self) -> Option<&dyn Error> {
|
/// fn cause(&self) -> Option<&dyn Error> {
|
||||||
/// Some(&self.side)
|
/// Some(&self.side)
|
||||||
/// }
|
/// }
|
||||||
|
@ -109,11 +105,7 @@ pub trait Error: Debug + Display {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for SuperErrorSideKick {
|
/// impl Error for SuperErrorSideKick {}
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "I'm SuperError side kick"
|
|
||||||
/// }
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// fn get_super_error() -> Result<(), SuperError> {
|
/// fn get_super_error() -> Result<(), SuperError> {
|
||||||
/// Err(SuperError { side: SuperErrorSideKick })
|
/// Err(SuperError { side: SuperErrorSideKick })
|
||||||
|
@ -159,10 +151,6 @@ pub trait Error: Debug + Display {
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for SuperError {
|
/// impl Error for SuperError {
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "I'm the superhero of errors"
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
|
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||||
/// Some(&self.side)
|
/// Some(&self.side)
|
||||||
/// }
|
/// }
|
||||||
|
@ -177,11 +165,7 @@ pub trait Error: Debug + Display {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for SuperErrorSideKick {
|
/// impl Error for SuperErrorSideKick {}
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "I'm SuperError side kick"
|
|
||||||
/// }
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// fn get_super_error() -> Result<(), SuperError> {
|
/// fn get_super_error() -> Result<(), SuperError> {
|
||||||
/// Err(SuperError { side: SuperErrorSideKick })
|
/// Err(SuperError { side: SuperErrorSideKick })
|
||||||
|
@ -261,11 +245,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for AnError {
|
/// impl Error for AnError {}
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "Description of an error"
|
|
||||||
/// }
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// let an_error = AnError;
|
/// let an_error = AnError;
|
||||||
/// assert!(0 == mem::size_of_val(&an_error));
|
/// 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 +
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Error for AnError {
|
/// impl Error for AnError {}
|
||||||
/// fn description(&self) -> &str {
|
|
||||||
/// "Description of an error"
|
|
||||||
/// }
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// unsafe impl Send for AnError {}
|
/// unsafe impl Send for AnError {}
|
||||||
///
|
///
|
||||||
|
|
|
@ -402,9 +402,7 @@ impl Error {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl error::Error for MyError {
|
/// impl error::Error for MyError {}
|
||||||
/// fn description(&self) -> &str { &self.v }
|
|
||||||
/// }
|
|
||||||
///
|
///
|
||||||
/// impl Display for MyError {
|
/// impl Display for MyError {
|
||||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue