Skip to content

No unused field warnings are produced on enums deriving thiserror::Error #446

Description

@eli-sauvage

see this playground example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=ef85fe807b9e27cb5ffbf6e3a11a1b0c

The warnings generated with a regular enum are not created for a thiserror enum, making it quite hard to catch unused fields in errors. Is this expected ?


From what I can see, if it helps for debugging:
thiserror version 1.0.59 did produce these warnings. However there were no way to disable them (adding #[allow(unused)] to the whole enum, or to the variant did not make the warning go away)

Thanks for the work !

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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions