Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serde_derive deserialize_with untagged enum regression #1268

Closed
arcnmx opened this issue May 20, 2018 · 2 comments
Closed

serde_derive deserialize_with untagged enum regression #1268

arcnmx opened this issue May 20, 2018 · 2 comments
Labels

Comments

@arcnmx
Copy link

arcnmx commented May 20, 2018

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).

@dtolnay
Copy link
Member

dtolnay commented May 20, 2018

Sorry about the break! I released 1.0.58 with a fix.

@arcnmx
Copy link
Author

arcnmx commented May 20, 2018

Super responsive and quick as always, thanks a lot!

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

No branches or pull requests

2 participants