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

Deserialize_with generates bad code if there is a type parameter called D #312

Closed
dtolnay opened this issue May 9, 2016 · 3 comments
Closed
Assignees
Milestone

Comments

@dtolnay
Copy link
Member

dtolnay commented May 9, 2016

Both of these generate code that fails to compile:

#[derive(Deserialize)]
struct S<D> {
    #[serde(deserialize_with="de")]
    d: D
}
#[derive(Deserialize)]
struct S<D> {
    d: D,
    #[serde(deserialize_with="de")]
    i: i32,
}
error: type parameter `D` shadows another type parameter of the same name [E0194]
                                     fn deserialize<D>(__d:
                                                    ^
@dtolnay
Copy link
Member Author

dtolnay commented May 11, 2016

Fixed in #315, can be closed.

@oli-obk
Copy link
Member

oli-obk commented May 11, 2016

if you add fixes #id to the PR, or a commit, the issues will be closed automatically when the PR is merged

@oli-obk oli-obk closed this as completed May 11, 2016
@dtolnay
Copy link
Member Author

dtolnay commented May 11, 2016

Neat, I will do that in the future. Please also close #90 #141 #158.

@dtolnay dtolnay added this to the v0.7.5 milestone May 14, 2016
@dtolnay dtolnay self-assigned this Jun 7, 2016
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