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

Switch from failure::Fail to std's Error trait #127

Merged
merged 1 commit into from
Mar 3, 2019

Conversation

jturner314
Copy link
Member

#118 simplified the LinalgError enum but also changed it from implementing Error to implementing Fail. This PR keeps the simplifications but changes it to implement Error again. (I also renamed the LapackFailure variant to Lapack, renamed the ShapeFailure variant to Shape and changed it to a tuple, and removed the braces from MemoryNotCont.) IMO this is better for a few reasons:

  1. failure is "experimental" and "currently evolving", so while it may be fine for an end-user application, I don't think we should use it for a library like ndarray-linalg.
  2. The standard library's Error is being updated based on the failure experiment to resolve most of the issues with the old version of Error. (RFC 2504) In stable, the .source() method has already been added, .cause() is planned to be deprecated in 1.33, and .description() is "soft-deprecated".
  3. It's annoying to have to call .compat() to get something that implements Error.

@termoshtt
Copy link
Member

failure is "experimental" and "currently evolving", so while it may be fine for an end-user application, I don't think we should use it for a library like ndarray-linalg.

This makse sense. Thanks PR.

@termoshtt termoshtt merged commit 9114302 into rust-ndarray:master Mar 3, 2019
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