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

Detect duplicate field names after rename attributes are applied #754

Closed
dtolnay opened this issue Feb 8, 2017 · 2 comments
Closed

Detect duplicate field names after rename attributes are applied #754

dtolnay opened this issue Feb 8, 2017 · 2 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented Feb 8, 2017

This should be an error from serde_derive rather than an unreachable pattern warning from rustc:

struct S {
    a: u8,
    #[serde(rename = "a")]
    b: u8,
}

@cholcombe973 hit this in https://gist.github.com/cholcombe973/a7bf280b1cd5b9cc941cd3e7ab16697a. You have two fields called "fop.fsetattr_count".

@Kixunil
Copy link
Contributor

Kixunil commented Nov 17, 2018

This would be really helpful. I just almost got bit by a similar problem: two fields renamed to the same name due to bad copy-paste.

@dtolnay
Copy link
Member Author

dtolnay commented Feb 1, 2019

Closing because I don't plan to pursue this as a priority.

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

No branches or pull requests

2 participants