Skip to content

Support useing externally defined macros behind #![feature(use_extern_macros)]#37732

Merged
bors merged 8 commits into
rust-lang:masterfrom
jseyfried:use_extern_macros
Nov 17, 2016
Merged

Support useing externally defined macros behind #![feature(use_extern_macros)]#37732
bors merged 8 commits into
rust-lang:masterfrom
jseyfried:use_extern_macros

Conversation

@jseyfried

@jseyfried jseyfried commented Nov 12, 2016

Copy link
Copy Markdown
Contributor

With #![feature(use_extern_macros)],

  • A name collision between macros from different upstream crates is much less of an issue since we can use the macros in different submodules or rename with as.
  • We can reexport macros with pub use, so #![feature(macro_reexport)] is no longer needed.
  • These reexports are allowed in any module, so crates can expose a macro-modular interface.

If a macro invocation can resolve to both a use import and a macro_rules! or #[macro_use], it is currently an ambiguity error.

r? @nrc

@jseyfried

Copy link
Copy Markdown
Contributor Author

cc #35896, #35900

@jseyfried jseyfried force-pushed the use_extern_macros branch 4 times, most recently from 8e1dcf6 to cc550af Compare November 13, 2016 11:41

@nrc nrc left a comment

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.

r = me with the style nits addressed

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.

formatting nit: prefer one arg per line

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.

style nit - sig - here and below

@bors

bors commented Nov 16, 2016

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #37545) made this pull request unmergeable. Please resolve the merge conflicts.

@jseyfried

Copy link
Copy Markdown
Contributor Author

@bors r=nrc

@bors

bors commented Nov 17, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 6cb33a0 has been approved by nrc

@bors

bors commented Nov 17, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 6cb33a0 with merge c57b826...

bors added a commit that referenced this pull request Nov 17, 2016
Support `use`ing externally defined macros behind `#![feature(use_extern_macros)]`

With `#![feature(use_extern_macros)]`,
 - A name collision between macros from different upstream crates is much less of an issue since we can `use` the macros in different submodules or rename with `as`.
 - We can reexport macros with `pub use`, so `#![feature(macro_reexport)]` is no longer needed.
 - These reexports are allowed in any module, so crates can expose a macro-modular interface.

If a macro invocation can resolve to both a `use` import and a `macro_rules!` or `#[macro_use]`, it is an ambiguity error.

r? @nrc
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.

3 participants