Skip to content

The std feature is not discoverable (was: FromBitsError doesn't implement Error) #46

Description

@drewcassidy

enumflags2 uses FromBitsError for the error for TryFrom, but the struct doesnt implement std::error::Error which makes it unwieldy to use, for example with the ? operator or a diagnostics package like Miette

45  | pub struct FromBitsError<T: BitFlag> {
    | ------------------------------------ doesn't satisfy `_: Error`
    |
    = note: the following trait bounds were not satisfied:
            `FromBitsError<DDSPixelFormatFlags>: std::error::Error`
            which is required by `Result<BitFlags<DDSPixelFormatFlags, u32>, FromBitsError<DDSPixelFormatFlags>>: IntoDiagnostic<BitFlags<DDSPixelFormatFlags, u32>, FromBitsError<DDSPixelFormatFlags>>`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions