-
Notifications
You must be signed in to change notification settings - Fork 123
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
#[derive_more::Error]
refers to std::
#261
Comments
The Error trait is not yet in |
Could you do an auto-detect using |
In the |
Seems reasonable to have in under feature flag. |
The `Error` derive can be made to work well for the most part in `no_std` environments by enabling `#![feature(error_in_core)]`. This changes the `Error` derive slightly to import `Error` and related traits from core, when the `std` feature is disabled. Fixes #261
The `Error` derive can be made to work well for the most part in `no_std` environments by enabling `#![feature(error_in_core)]`. This changes the `Error` derive slightly to import `Error` and related traits from core, when the `std` feature is disabled. Fixes #261
The `Error` derive can be made to work well for the most part in `no_std` environments by enabling `#![feature(error_in_core)]`. This changes the `Error` derive slightly to import `Error` and related traits from core, when the `std` feature is disabled. Fixes #261
@StackOverflowExcept1on I created a PR that adds support for the Error derive in no_std environments in #268. It also includes some tests, but could you double check that it solves your problem? |
The `Error` derive can be made to work well for the most part in `no_std` environments by enabling `#![feature(error_in_core)]`. This changes the `Error` derive slightly to import `Error` and related traits from core, when the `std` feature is disabled. Fixes #261
Looks good, but for example snafu has a polyfill for |
@StackOverflowExcept1on is having a polyfill critical for you? We don't want deviate much from what |
@tyranron this is not critical, but it would be useful for stable crates |
I looked into using the same polyfill approach as snafu. But I don't that fits well with the ideas behind this crate, especially since the Error trait is on the path to being stabilized (although that will probably take some more time). Every Error derive crate creating its own Error polyfill is also really bad for the general ecosystem, since none of them will be able to work together. It might be better to actually have add a crate feature which uses the snafu polyfill. |
Resolves #261 ## Synopsis The `Error` derive can be made to work well for the most part in `no_std` environments by enabling `#![feature(error_in_core)]`. This changes the `Error` derive slightly to import `Error` and related traits from core, when the `std` feature is disabled. In passing this also fixes actually running the nightly error tests. They were not actually run anymore because there was no `build.rs` file in the root of the repo, only in the `impl` package. So the `nightly` config was not available in tests. Co-authored-by: tyranron <[email protected]>
I did two simple libraries here: https://github.com/StackOverflowExcept1on/derive-more-issue/
Why doesn't the library provide
impl core::error::Error for Error
?The text was updated successfully, but these errors were encountered: