Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Losing non-syntex derive behind cfg_attr #110

Open
dtolnay opened this issue Jan 7, 2017 · 0 comments
Open

Losing non-syntex derive behind cfg_attr #110

dtolnay opened this issue Jan 7, 2017 · 0 comments
Labels

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Jan 7, 2017

Moved from serde-rs/serde#616.

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.

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

No branches or pull requests

1 participant