-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Support use
ing externally defined macros behind #![feature(use_extern_macros)]
#37732
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
65da379
to
a75cc5b
Compare
8e1dcf6
to
cc550af
Compare
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.
r = me with the style nits addressed
self.used_crates.insert(def.def_id().krate); | ||
fn legacy_import_macro( | ||
&mut self, name: Name, binding: &'b NameBinding<'b>, span: Span, allow_shadowing: bool, | ||
) { |
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.
formatting nit: prefer one arg per line
parent: Module<'b>, | ||
vis: ty::Visibility) { | ||
fn build_reduced_graph_for_variant( | ||
&mut self, variant: &Variant, parent: Module<'b>, vis: ty::Visibility, expansion: Mark, |
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.
style nit - sig - here and below
☔ The latest upstream changes (presumably #37545) made this pull request unmergeable. Please resolve the merge conflicts. |
cc550af
to
6cb33a0
Compare
@bors r=nrc |
📌 Commit 6cb33a0 has been approved by |
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
With
#![feature(use_extern_macros)]
,use
the macros in different submodules or rename withas
.pub use
, so#![feature(macro_reexport)]
is no longer needed.If a macro invocation can resolve to both a
use
import and amacro_rules!
or#[macro_use]
, it is currently an ambiguity error.r? @nrc