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

Disallow variant field names to conflict with tag of internally-tagged enum #1170

Merged
merged 5 commits into from Mar 8, 2018

Conversation

H2CO3
Copy link
Contributor

@H2CO3 H2CO3 commented Mar 7, 2018

Fixes #1161.

@oli-obk
Copy link
Member

oli-obk commented Mar 8, 2018

Could you add a test for it?

@H2CO3
Copy link
Contributor Author

H2CO3 commented Mar 8, 2018

Sure thing!

@H2CO3
Copy link
Contributor Author

H2CO3 commented Mar 8, 2018

@oli-obk Hey, could you help me with adding tests? I can't even run the test suite. I have latest nightly, but when I run

cargo +nightly test --features="unstable"

then basically every compile-time test fails, with errors such as

error: tests/compile-fail/remote/wrong_de.rs:10: unexpected error: '10:1: 10:27: can't find crate for `serde_derive` [E0463]'

and

found crate `serde_derive` compiled by an incompatible version of rustc [E0514]

What am I missing?

@oli-obk
Copy link
Member

oli-obk commented Mar 8, 2018

That's an unfortunate side effect of compiletest-rs. You need to run cargo clean or even rustup override set nightly instead of cargo +nighty

@H2CO3
Copy link
Contributor Author

H2CO3 commented Mar 8, 2018

I've already tried cleaning; in fact, I've deleted and re-git clone'd the entire repository, without success :( rustup override set stable doesn't seem to have helped either, I still get the very same errors.

Just to be clear: I've set up my cargo config so that all serde-related dependencies are searched for locally. Cargo build reports:

Compiling serde v1.0.27 (file:///Users/H2CO3/Projects/serde/serde)
Compiling serde_derive_internals v0.19.0 (file:///Users/H2CO3/Projects/serde/serde_derive_internals)
Compiling serde_derive v1.0.27 (file:///Users/H2CO3/Projects/serde/serde_derive)
Compiling serde_test v1.0.27 (file:///Users/H2CO3/Projects/serde/serde_test)
Compiling serde_test_suite v0.0.0 (file:///Users/H2CO3/Projects/serde/test_suite)

Am I correct that this is what should be done? Or could that be the source of the problem?

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is terrific work.

I was experimenting with this anyway so I just copied my own experiments here as tests. For the future ./travis.sh will run everything that we care about testing in CI. You should be able to grab commands out of there to run only the parts you want.

@dtolnay dtolnay merged commit 8dd5605 into serde-rs:master Mar 8, 2018
@H2CO3
Copy link
Contributor Author

H2CO3 commented Mar 8, 2018

@dtolnay hey there! Thanks for the tests and the guidance. I'm glad you found this useful. 👍

@H2CO3 H2CO3 deleted the disallow_internal_tag_conflict branch March 8, 2018 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants