Skip to content

Option to impl Error under feature flag #43

@jhpratt

Description

@jhpratt

Right now, I have an enum for various error types. Display is in core, so that's implemented unconditionally. However, Error only exists in std, so I've put it behind a feature flag (named "std") to allow compatibility with #![no_std]. Having the ability to do this programmatically would be helpful for this use case.

Something like this would be workable, I think.

#[derive(Error)]
#[error_feature = "std"]
enum Foo { ... }

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