implement core::error::Error
(dynamic approach)
#629
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this trait has been stabilised in Rust 1.81.0.
the existing custom
Error
types cannot be removed / replaced as that'd be a breaking change. for the same reason it's not possible for them to requirecore::error::Error
being implemented.however, we can add an
impl core::error::Error for dyn Error
for every custom error type to provide an automatic coverage. HALs can still add an implementation for their specific error type if they wish to add more details (e.g. implementsource
).as
core::error::Error
requirescore::fmt::Display
to be implemented a simple blanket implementation has been added which prints theDebug
output.existing
std
feature-gated implementations ofstd::error::Error
have also been moved tocore::error::Error
and the feature gate removed.this raises the MSRV to 1.81.0 for most crates, but based on the MSRV policy this should not be an issue.