Skip to content

Forbid conflicts between macros 1.0 exports and macros 2.0 exports#40509

Merged
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:duplicate_check_macro_exports
Mar 23, 2017
Merged

Forbid conflicts between macros 1.0 exports and macros 2.0 exports#40509
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:duplicate_check_macro_exports

Conversation

@jseyfried

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

cc #35896
cc @sergio

@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 either way

Comment thread src/librustc_resolve/lib.rs 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.

Could the span be added to Export?

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@bors r=nrc

@bors

bors commented Mar 16, 2017

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Mar 21, 2017

Copy link
Copy Markdown
Collaborator

🔒 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

bstrie commented Mar 21, 2017

Copy link
Copy Markdown
Contributor

@bors r=nrc

@bors

bors commented Mar 21, 2017

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Mar 22, 2017

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Mar 22, 2017

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@alexcrichton

Copy link
Copy Markdown
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