-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Forbid conflicts between macros 1.0 exports and macros 2.0 exports #40509
Forbid conflicts between macros 1.0 exports and macros 2.0 exports #40509
Conversation
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 either way
src/librustc_resolve/lib.rs
Outdated
@@ -1178,7 +1178,7 @@ pub struct Resolver<'a> { | |||
macro_map: FxHashMap<DefId, Rc<SyntaxExtension>>, | |||
macro_defs: FxHashMap<Mark, DefId>, | |||
local_macro_def_scopes: FxHashMap<NodeId, Module<'a>>, | |||
macro_exports: Vec<Export>, | |||
macro_exports: Vec<(Export, Span)>, |
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.
Could the span be added to Export?
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.
Sure.
27d2deb
to
8c16c45
Compare
@bors r=nrc |
📌 Commit 8c16c45 has been approved by |
…orts, r=nrc Forbid conflicts between macros 1.0 exports and macros 2.0 exports This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example, ```rust // crate A: pub use macros::foo; //^ This is allowed today, will be forbidden by this PR. // crate B: extern crate A; // This triggers a confusing error today. use A::foo; // This could refer to refer to either macro export in crate A. ``` r? @nrc
…orts, r=nrc Forbid conflicts between macros 1.0 exports and macros 2.0 exports This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example, ```rust // crate A: pub use macros::foo; //^ This is allowed today, will be forbidden by this PR. // crate B: extern crate A; // This triggers a confusing error today. use A::foo; // This could refer to refer to either macro export in crate A. ``` r? @nrc
…orts, r=nrc Forbid conflicts between macros 1.0 exports and macros 2.0 exports This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example, ```rust // crate A: pub use macros::foo; //^ This is allowed today, will be forbidden by this PR. // crate B: extern crate A; // This triggers a confusing error today. use A::foo; // This could refer to refer to either macro export in crate A. ``` r? @nrc
🔒 Merge conflict |
…[macro_reexport]`) and macros 2.0 exports (`pub use` macro re-exports and `pub macro` (once implemented) at the crate root.
8c16c45
to
678e882
Compare
@bors r=nrc |
📌 Commit 678e882 has been approved by |
…orts, r=nrc Forbid conflicts between macros 1.0 exports and macros 2.0 exports This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example, ```rust // crate A: pub use macros::foo; //^ This is allowed today, will be forbidden by this PR. // crate B: extern crate A; // This triggers a confusing error today. use A::foo; // This could refer to refer to either macro export in crate A. ``` r? @nrc
⌛ Testing commit 678e882 with merge 16b9ffb... |
💔 Test failed - status-travis |
@bors: retry
|
…orts, r=nrc Forbid conflicts between macros 1.0 exports and macros 2.0 exports This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example, ```rust // crate A: pub use macros::foo; //^ This is allowed today, will be forbidden by this PR. // crate B: extern crate A; // This triggers a confusing error today. use A::foo; // This could refer to refer to either macro export in crate A. ``` r? @nrc
This PR forbids for conflicts between
#[macro_export]
/#[macro_reexport]
macro exports andpub use
macro exports. For example,r? @nrc