Skip to content

Crate isn't really no-std compatible #47

@tomaka

Description

@tomaka

#39 supposedly added support for no-std.

However I strongly disagree with this point:

Uses of std::error::Error are conditionally replaced with core::error::Error. This is currently unstable, so nightly is required for no_std usage for the time being. I believe it is still not possible to build a no_std binary without nightly, so this should be an acceptable requirement.

You can't really consider a crate to be "no-std compatible" if it requires nightly.
And let's face it: at the rhythm where it's going (the first attempts at moving this trait were in 2021), it's going to take a very long time for core::error::Error to be stabilized.

My suggestion would be to not derive the Error trait at all, but only Debug and Display and possible Clone. This can be done by ditching the thiserror crate and using a different one.
After all, the Error trait isn't very useful. All it does is potentially provide a stack trace. It's not because it's named "error" that types that represent errors always have to derive it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions