Skip to content

Kicking off libproc_macro#35538

Merged
bors merged 1 commit into
rust-lang:masterfrom
cgswords:libproc_macro
Aug 17, 2016
Merged

Kicking off libproc_macro#35538
bors merged 1 commit into
rust-lang:masterfrom
cgswords:libproc_macro

Conversation

@cgswords

@cgswords cgswords commented Aug 8, 2016

Copy link
Copy Markdown
Contributor

This PR introduces libproc_macro, which is currently quite bare-bones (just a few macro construction tools and an initial quote! macro).

This PR also introduces a few test cases for it, and an additional shim file (at src/libsyntax/ext/proc_macro_shim.rs to allow a facsimile usage of Macros 2.0 today!

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@cgswords

cgswords commented Aug 8, 2016

Copy link
Copy Markdown
Contributor Author

r? @nrc

Whoops, forgot to tag @nrc for reviewer.

Comment thread mk/crates.mk Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

deps are inconsistent between here, the Cargo.toml, and the extern crates

@nrc

nrc commented Aug 10, 2016

Copy link
Copy Markdown
Member

I'm not sure I know what you mean.

I thought we landed your quote macro in libsyntax, which means with this PR there are two copies in the codebase. Can we remove the one from libsyntax? (Or am I misremembering landing it?)

@nrc

nrc commented Aug 10, 2016

Copy link
Copy Markdown
Member

r=me with tests passing and perhaps removing the old quote (if it exists)

@cgswords

cgswords commented Aug 10, 2016

Copy link
Copy Markdown
Contributor Author

You're misremembering. This is the first quote macro.

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@cgswords Can you squash?

@cgswords

Copy link
Copy Markdown
Contributor Author

@eddyb Done!

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@cgswords Looking more at it, I think you'll need to start a rustbuild build to update Cargo.lock.

@cgswords

Copy link
Copy Markdown
Contributor Author

@eddyb That should do that.

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@bors r=nrc

@bors

bors commented Aug 16, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit d9d6e8c has been approved by nrc

@bors

bors commented Aug 16, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d9d6e8c with merge 38002f1...

@cgswords cgswords force-pushed the libproc_macro branch 2 times, most recently from 7df1036 to 6ef1bbc Compare August 16, 2016 13:27
@cgswords

cgswords commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

Er, accidental re-push. Travis is failing because tidy reports that I have libproc_macro in librustc_driver's toml file, but don't use it in the driver. Is there a different Cargo.toml I can put it in? (I can't extern crate it because it defines a plugin.) (cc @alexcrichton for the proper fix)

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@cgswords I would actually expect it to depend on nothing but libstd, and libsyntax to depend on it, in the long run.

@cgswords

Copy link
Copy Markdown
Contributor Author

@eddyb I can't imagine why libsyntax would rely on it; it's the user-facing abstraction over libsyntax, so it internally needs access to that.

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@cgswords My intuition is reversed, having libsyntax be a grammar wrapper around libmacro.

Either way, can you make libsyntax_ext use it? That should solve the dependency rooting problem.

@cgswords

Copy link
Copy Markdown
Contributor Author

@eddyb That won't stop it from throwing the "plugin as library" warning. @alexcrichton how should we shim this?

@alexcrichton

Copy link
Copy Markdown
Member

@cgswords you can add an entry to the whitelist here

@cgswords

Copy link
Copy Markdown
Contributor Author

Whitelist entry added.

@eddyb

eddyb commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

@bors r=nrc

@bors

bors commented Aug 16, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 98c8e0a has been approved by nrc

@bors

bors commented Aug 16, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 98c8e0a with merge 1bf5fa3...

bors added a commit that referenced this pull request Aug 16, 2016
Kicking off libproc_macro

This PR introduces `libproc_macro`, which is currently quite bare-bones (just a few macro construction tools and an initial `quote!` macro).

This PR also introduces a few test cases for it, and an additional `shim` file (at `src/libsyntax/ext/proc_macro_shim.rs` to allow a facsimile usage of Macros 2.0 *today*!
@bors bors merged commit 98c8e0a into rust-lang:master Aug 17, 2016
@cgswords

Copy link
Copy Markdown
Contributor Author

🤘

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.

7 participants