Skip to content

any chance of having something like #[serde(crate = "...")] for thiserror? #386

@hmacias-avaya

Description

@hmacias-avaya

I'm trying to use the latest thiserror 2 and until now I was reexporting thiserror from a common dependency so my "end project" was not depending on thiserror directly.
Now this is no longer possible and is mentioned on the breaking changes section:

Code containing invocations of thiserror's derive(Error) must now have a direct dependency on the thiserror crate regardless of the error data structure's contents

is there any chance of having something like serde's 'crate' annotation in order to be able to use thiserror derives without depending on thiserror directly?
https://serde.rs/container-attrs.html#crate

This seems to work nicely when using serde's derives; perhaps it could work here as well?

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