-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Add test for expansion inside of cfg_attr #382
Conversation
r=me once serde-deprecated/syntex#71 lands. |
I marked this WIP until we get a Syntex release to depend on. As far as I know nobody is waiting urgently for this so we can just wait for the next libsyntax break. |
Add test for expansion inside of cfg_attr Test for #148. Requires serde-deprecated/syntex#71 + Syntex release.
@dtolnay: syntex is updated, but this is failing on stable and beta with things like:
Do you know what's up? Maybe the bug hasn't been fixed in syntex yet. |
That's so strange. It works on the nightly compiler using Syntex, but not on the beta compiler using Syntex. What would be the difference between those? The generated code looks correct in both cases: #[cfg_attr(all(), derive(PartialEq, Debug))]
struct NamedUnit;
#[cfg(all())]
const _IMPL_DESERIALIZE_FOR_NamedUnit: () = { /* ... */ };
#[cfg(all())]
const _IMPL_SERIALIZE_FOR_NamedUnit: () = { /* ... */ }; |
Interesting, |
#[cfg_attr(all(), cfg_attr(all(), derive(Debug)))]
struct S;
fn main() {
println!("{:?}", S);
} This works on nightly but not stable/beta. Playground link I am going to write this off as a bug that needed to be fixed in both Syntex and rustc. We can add the test later when we support only versions that contain the rustc side of the fix. |
Test for #148. Requires serde-deprecated/syntex#71 + Syntex release.