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 deprecated Error::description and Error::cause #933

Conversation

AnderEnder
Copy link

Error::description has been documented as soft-deprecated since 1.27.0 (17 months ago). It is going to be hard-deprecated soon. Error::cause has been documented as deprecated since 1.33.0.

This PR:

  • Removes all implementations of description and cause in all error types

Related PR: rust-lang/rust#66919

Copy link
Owner

@briansmith briansmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Will this affect the minimum supported Rust version? I.e. is this a breaking change at all?

@@ -149,7 +140,7 @@ impl From<core::array::TryFromSliceError> for Unspecified {
pub struct KeyRejected(&'static str);

impl KeyRejected {
/// The value returned from <Self as std::error::Error>::description()
/// The value is used in Display
pub fn description_(&self) -> &'static str {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think description_() should be removed; its code should be inlined into the Display implementation.

}

fn description(&self) -> &str {
Self::description_()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description_() should be removed and inlined into the Display implementation.

@briansmith
Copy link
Owner

@AnderEnder Thanks for the PR. I created a new PR that implements the changes I requested: #938, so I'm going to close this one.

@briansmith briansmith closed this Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants