-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Create a derive macro for HashStable and allow proc macros in rustc #58013
Conversation
Blocked on rust-lang/cargo#6547 |
The macro looks awesome. This should let us get rid of so much boilerplate. Also, the |
I haven't been following this too too closely, but @Zoxc can you detail a bit more what some of the changes are to linking and such? |
I'm just going to list the changes enabling proc macros.
|
This comment has been minimized.
This comment has been minimized.
[package] | ||
name = "rustc_macros" | ||
version = "0.1.0" | ||
authors = ["The Rust Project Developers"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make this a rust 2018 crate? Otherwise, somebody will come along and do that later for #58099 anyway, leading to more churn...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could/should enforce this via tidy once we have all of them ported
FWIW I don't think I'll have much to add any more to this, so long as it works and bootstraps seems fine by me, I wouldn't block on me for this. |
c5b0065
to
441e350
Compare
We'll need to get rust-lang/cargo#6547 into beta before this can be merged. |
This PR is now unblocked :) |
@vext01 it's not that easy. |
Ping @eddyb for review of the proc macro parts. |
This comment has been minimized.
This comment has been minimized.
441e350
to
756241d
Compare
This comment has been minimized.
This comment has been minimized.
756241d
to
5fae5f7
Compare
This comment has been minimized.
This comment has been minimized.
5fae5f7
to
8746683
Compare
@rust-lang/compiler Do we have someone else who can review the proc macro changes in rustc here? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
⌛ Testing commit f2ef283 with merge c1187c488edaf9d9874c5ca40840552b436cf003... |
@bors retry |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors p=0 |
@bors p=500 |
Create a derive macro for HashStable and allow proc macros in rustc A combination of #56864 and #56795. There were complications with using `serde_derive` as rustc doesn't know which crate to use for the host when there is a serde_derive in the sysroot and cargo passes another on the command line built from crates.io. r? @eddyb (for proc macro changes) @alexcrichton (for rustbuild changes) @michaelwoerister (for the macro itself)
@bors treeclosed- p=2 |
☀️ Test successful - checks-travis, status-appveyor |
🎉 |
@@ -258,7 +260,7 @@ pub struct Context<'a> { | |||
pub extra_filename: Option<&'a str>, | |||
// points to either self.sess.target.target or self.sess.host, must match triple | |||
pub target: &'a Target, | |||
pub triple: &'a TargetTriple, | |||
pub triple: TargetTriple, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nnethercote
@@ -1232,6 +1232,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, | |||
Use with RUST_REGION_GRAPH=help for more info"), | |||
parse_only: bool = (false, parse_bool, [UNTRACKED], | |||
"parse only; do not compile, assemble, or link"), | |||
dual_proc_macros: bool = (false, parse_bool, [TRACKED], | |||
"load proc macros for both target and host, but only link to the target"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being so late to see this, but can an issue be opened to track this "feature"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #64671
@Zoxc what's the reason for the last commit ("make cargo a rustc tool again")? It prevents building cargo without building the whole compiler first. |
@jyn514 looks like it resolves this failure #58013 (comment), and it's just a revert of e501a87 in this PR - if you look at the full diff, this PR doesn't change that part of |
Hmm ok - I was hoping to remove that dependency in #84780 (comment), I guess I should test freebsd locally. Yes, probably wrong git blame, thanks for the pointer :) |
I suspect this will show up on linux too, it looks like some sort of Cargo feature conflict between tools. EDIT: keep in mind Lines 87 to 94 in c825bc4
|
A combination of #56864 and #56795. There were complications with using
serde_derive
as rustc doesn't know which crate to use for the host when there is a serde_derive in the sysroot and cargo passes another on the command line built from crates.io.r? @eddyb (for proc macro changes) @alexcrichton (for rustbuild changes) @michaelwoerister (for the macro itself)