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

Support serde(bound = "...") attribute on enum variants #1149

Closed
dtolnay opened this issue Jan 24, 2018 · 1 comment
Closed

Support serde(bound = "...") attribute on enum variants #1149

dtolnay opened this issue Jan 24, 2018 · 1 comment
Assignees

Comments

@dtolnay
Copy link
Member

dtolnay commented Jan 24, 2018

Variants support with so it makes sense to support bound as well. The two commonly go together.

#[derive(Serialize, Deserialize)]
enum Repro<T> {
    #[serde(with = "v")]
    #[serde(bound(serialize = "T: Serialize", deserialize = "T: Deserialize<'de>"))]
    V(T),
}

Currently this fails with:

 |
 | #[derive(Serialize, Deserialize)]
 |                     ^^^^^^^^^^^
 |
 = help: message: unknown serde variant attribute `bound`
@dtolnay dtolnay self-assigned this May 7, 2018
@dtolnay
Copy link
Member Author

dtolnay commented May 8, 2018

Fixed in be7fe2a.

@dtolnay dtolnay closed this as completed May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant