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_codegen seems to be removing derive()s with some cfg attrs #616

Closed
vvuk opened this issue Nov 11, 2016 · 1 comment
Closed

serde_codegen seems to be removing derive()s with some cfg attrs #616

vvuk opened this issue Nov 11, 2016 · 1 comment
Assignees

Comments

@vvuk
Copy link

vvuk commented Nov 11, 2016

This is a bit of a weird one.

See this commit for a needed workaround: servo/webrender@efd4e1d

With some analysis at servo/webrender#549 (comment) -- basically, given:

#[cfg_attr(all(unix, not(target_os = "macos")), derive(Clone, Serialize, Deserialize))]

Serialize and Deserialize have code generated, but the resulting code does not retain #[cfg_attr(..., derive(Clone)] as it should. (or even just #[derive(Clone)], if codegen is supposed to evaluate cfgs.) But

#[cfg_attr(not(any(target_os = "macos", target_os = "windows")), derive(Clone, Serialize, Deserialize))]

works. Can be reproduced by checking out webrender from servo/webrender@6a2f354 and building on linux.

@dtolnay
Copy link
Member

dtolnay commented Jan 7, 2017

I moved this to serde-deprecated/syntex#110 because Serde will no longer be using Syntex after Macros 1.1 is stable.

@dtolnay dtolnay closed this as completed Jan 7, 2017
@dtolnay dtolnay self-assigned this Apr 9, 2017
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