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

Macros 1.1 #3064

Merged
merged 6 commits into from
Sep 6, 2016
Merged

Macros 1.1 #3064

merged 6 commits into from
Sep 6, 2016

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Sep 1, 2016

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

dtolnay added a commit to serde-rs/serde that referenced this pull request Sep 1, 2016
@Ericson2314
Copy link
Contributor

Um what about the dependency side of things? Are we going with plugin = true-style stuff? Has this even been decided? I I think rather have a new category of dependency in addition to dependencies dev-dependencies build-dependencies.

@dtolnay
Copy link
Member Author

dtolnay commented Sep 1, 2016

@Ericson2314 this was part of the RFC. See Initial Cargo integration and Macros 1.1 in practice.

.set_for_host(match (toml.plugin, toml.rustc_macro) {
(None, None) => t2.for_host(),
(Some(true), _) | (_, Some(true)) => true,
_ => false,
Copy link
Member

Choose a reason for hiding this comment

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

Could this explicitly bind the Some(false) here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well out of the 9 cases, 1 is handled by the first line and 5 are handled by the second line so there are 3 left:

(None, Some(false))
(Some(false), None)
(Some(false), Some(false))

Are you suggesting this?

(Some(false), _) | (_, Some(false)) => false

I think the current code is clearer. It says "if nothing is set, inherit; if anything is true, then true otherwise false." The explicitly bound Some(false) looks like it means "if anything is false, then false" but that is misleading because (Some(true), Some(false)) is true.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yes, the latter. Just writing out what the case is catching vs "something we accidentally forgot to cover above"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@Ericson2314
Copy link
Contributor

@dtolnay that's fair. I've made amore detailed comment in the RFC tracking issue—it makes more sense to discuss there than here as I'd assume you'd agree.

@alexcrichton
Copy link
Member

Looking good to me! I'll look to merge once rustc support lands and we've got a nightly.

@dtolnay
Copy link
Member Author

dtolnay commented Sep 4, 2016

I pushed an empty commit to retrigger the builds. Linux and OS X pass in Travis. Looks like AppVeyor is getting a really old nightly for some reason: rustc 1.12.0-nightly (7ad125c4e 2016-07-11).

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Sep 6, 2016

📌 Commit acf34bb has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 6, 2016

⌛ Testing commit acf34bb with merge 25d2868...

@bors
Copy link
Contributor

bors commented Sep 6, 2016

💔 Test failed - cargo-linux-64

@alexcrichton
Copy link
Member

Oh I think src/rustversion.txt may need to be updated as well?

@dtolnay
Copy link
Member Author

dtolnay commented Sep 6, 2016

Done.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 6, 2016

📌 Commit 7ee6f57 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 6, 2016

⌛ Testing commit 7ee6f57 with merge afaffa1...

bors added a commit that referenced this pull request Sep 6, 2016
Macros 1.1

Tested with serde-rs/serde#530. This should be able to merge independently of rust-lang/rust#35957.

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Sep 6, 2016

☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64
Approved by: alexcrichton
Pushing afaffa1 to master...

@bors bors merged commit 7ee6f57 into rust-lang:master Sep 6, 2016
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.

5 participants