Skip to content
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

Merged
merged 1 commit into from
Mar 23, 2017

Conversation

jseyfried
Copy link
Contributor

This PR forbids for conflicts between #[macro_export]/#[macro_reexport] macro exports and pub use macro exports. For example,

// crate A:
pub use macros::foo;
#[macro_export] macro_rules! 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

@jseyfried
Copy link
Contributor Author

cc #35896
cc @sergio

Copy link
Member

@nrc nrc left a 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

@@ -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)>,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@jseyfried jseyfried force-pushed the duplicate_check_macro_exports branch from 27d2deb to 8c16c45 Compare March 16, 2017 01:31
@jseyfried
Copy link
Contributor Author

@bors r=nrc

@bors
Copy link
Contributor

bors commented Mar 16, 2017

📌 Commit 8c16c45 has been approved by nrc

arielb1 pushed a commit to arielb1/rust that referenced this pull request Mar 18, 2017
…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
bors added a commit that referenced this pull request Mar 18, 2017
arielb1 pushed a commit to arielb1/rust that referenced this pull request Mar 19, 2017
…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
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 20, 2017
…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
@bors
Copy link
Contributor

bors commented Mar 21, 2017

🔒 Merge conflict

…[macro_reexport]`)

and macros 2.0 exports (`pub use` macro re-exports and `pub macro` (once implemented)
at the crate root.
@retep998 retep998 force-pushed the duplicate_check_macro_exports branch from 8c16c45 to 678e882 Compare March 21, 2017 20:24
@bstrie
Copy link
Contributor

bstrie commented Mar 21, 2017

@bors r=nrc

@bors
Copy link
Contributor

bors commented Mar 21, 2017

📌 Commit 678e882 has been approved by nrc

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 22, 2017
…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
@bors
Copy link
Contributor

bors commented Mar 22, 2017

⌛ Testing commit 678e882 with merge 16b9ffb...

@bors
Copy link
Contributor

bors commented Mar 22, 2017

💔 Test failed - status-travis

@alexcrichton
Copy link
Member

@bors: retry

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 22, 2017
…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
bors added a commit that referenced this pull request Mar 22, 2017
Rollup of 13 pull requests

- Successful merges: #40509, #40523, #40548, #40578, #40619, #40689, #40690, #40692, #40704, #40722, #40723, #40725, #40732
- Failed merges:
@bors bors merged commit 678e882 into rust-lang:master Mar 23, 2017
@jseyfried jseyfried deleted the duplicate_check_macro_exports branch March 23, 2017 03:14
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.

5 participants