Skip to content

serde_derive deserialize_with untagged enum regression #1268

@arcnmx

Description

@arcnmx

I still need to create a simple reproduction for the issue, and not sure if this is covered by another issue report, but effectively...

#[derive(Deserialize)]
#[serde(untagged)]
enum E {
    Variant(
        #[serde(deserialize_with="...")]
        Ty
    ),
}

Now fails to compile with a type mismatch error where it used to work properly. Moving the attribute outside of the variant (#[serde(deserialize_with="...")] Variant(Ty)) seems to work on both and I believe should be equivalent and a valid workaround for now? Tested with serde_derive v1.0.29 (worked) and v1.0.57 (broken).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions