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

Fix Serde derive import to better interact with downstream code #1445

Closed

Conversation

kkdawkins
Copy link
Contributor

React to Serde issue: serde-rs/serde#1441

@arsing
Copy link
Member

arsing commented Jul 13, 2019

I assume there's no actual crate that has this problem, and you're doing this defensively? I say this because none of our crates currently import serde with the feature enabled, and none of our crates are intended to be used by any third-party crates as dependencies that we would have to cater to (ie there's no "downstream" to "fix" for). Is this correct?

Anyway, I've been aware of that issue but I don't agree with the resolution. It makes it so that you end up treating an optional feature as required ("never import serde without enabling this feature"), and more importantly it breaks any other crates in the crate graph (not necessarily your ancestors or descendants, but completely unrelated sibling crates) that do have the original issue of importing serde::Serialize and serde_derive::Serialize simultaneously.

My preference is to use fully-qualified attribute paths instead (ie #[derive(serde_derive::Deserialize)]), which is also what I do in my own crates.

Thoughts?

@kkdawkins
Copy link
Contributor Author

@arsing - Actually, this PR was a reaction to Claire's project which uses some of our crates as a downstream dependency. That's how we discovered the issue :)

I am not opposed to your proposed solution, I was simply using the guidance from serde.rs as a way of fixing the issue.

@kkdawkins kkdawkins closed this Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants