Skip to content

resolve: fix bug in duplicate checking for extern crates#30295

Merged
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:fix_extern_crate_duplicate
Jan 11, 2016
Merged

resolve: fix bug in duplicate checking for extern crates#30295
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:fix_extern_crate_duplicate

Conversation

@jseyfried

Copy link
Copy Markdown
Contributor

Fix a bug allowing an item and an external crate to collide so long as the external crate is declared after the item. For example,

mod core { pub fn f() {} } // This would be an error if it followed the `extern crate`
extern crate core; // This declaration is shadowed by the preceding module

fn main() { core::f(); }

This is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by removing colliding extern crate declarations, which are shadowed and hence unused.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@jseyfried

Copy link
Copy Markdown
Contributor Author

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned pnkfelix Dec 11, 2015
@nrc

nrc commented Dec 11, 2015

Copy link
Copy Markdown
Member

r+

cc @rust-lang/compiler does this need a Crater run? I think not, but does anyone think we should?

@nagisa

nagisa commented Dec 29, 2015

Copy link
Copy Markdown
Member

@nrc ping?

@nrc

nrc commented Dec 29, 2015

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Dec 29, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 0310a7a has been approved by nrc

@bors

bors commented Dec 30, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 0310a7a with merge d91bf3f...

@bors

bors commented Dec 30, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-linux-64-nopt-t

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.

This cannot be merged anymore because in master, the type of this match statement has changed. While it still merges cleanly, it will not compile.

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.

@nagisa Thanks for the diagnosis

@jseyfried jseyfried force-pushed the fix_extern_crate_duplicate branch 3 times, most recently from 8ae7d1b to 0c64dda Compare January 6, 2016 02:06
@jseyfried jseyfried force-pushed the fix_extern_crate_duplicate branch from 0c64dda to 834fb17 Compare January 6, 2016 07:07
@jseyfried

Copy link
Copy Markdown
Contributor Author

@nrc rebased

@nrc

nrc commented Jan 7, 2016

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Jan 7, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 834fb17 has been approved by nrc

@bors

bors commented Jan 7, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 834fb17 with merge 3917c98...

@bors

bors commented Jan 7, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-linux-64-nopt-t

@brson

brson commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

@bors retry

bors added a commit that referenced this pull request Jan 8, 2016
Fix a bug allowing an item and an external crate to collide so long as the external crate is declared after the item. For example,
```rust
mod core { pub fn f() {} } // This would be an error if it followed the `extern crate`
extern crate core; // This declaration is shadowed by the preceding module

fn main() { core::f(); }
```
This is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by removing colliding `extern crate` declarations, which are shadowed and hence unused.
@bors

bors commented Jan 8, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 834fb17 with merge dfbb422...

@pnkfelix

pnkfelix commented Jan 9, 2016

Copy link
Copy Markdown
Contributor

@bors retry force

@pnkfelix

pnkfelix commented Jan 9, 2016

Copy link
Copy Markdown
Contributor

@bors r-

@pnkfelix

pnkfelix commented Jan 9, 2016

Copy link
Copy Markdown
Contributor

@bors r=nrc force

@bors

bors commented Jan 9, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 834fb17 has been approved by nrc

nagisa added a commit to nagisa/rust that referenced this pull request Jan 9, 2016
…e, r=nrc

Fix a bug allowing an item and an external crate to collide so long as the external crate is declared after the item. For example,
```rust
mod core { pub fn f() {} } // This would be an error if it followed the `extern crate`
extern crate core; // This declaration is shadowed by the preceding module

fn main() { core::f(); }
```
This is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by removing colliding `extern crate` declarations, which are shadowed and hence unused.
@bors

bors commented Jan 11, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 834fb17 with merge c9b4826...

@bors

bors commented Jan 11, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-win-gnu-64-nopt-t

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

On Mon, Jan 11, 2016 at 3:09 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-nopt-t/builds/2642


Reply to this email directly or view it on GitHub
#30295 (comment).

@bors

bors commented Jan 11, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 834fb17 with merge 69e1f57...

bors added a commit that referenced this pull request Jan 11, 2016
Fix a bug allowing an item and an external crate to collide so long as the external crate is declared after the item. For example,
```rust
mod core { pub fn f() {} } // This would be an error if it followed the `extern crate`
extern crate core; // This declaration is shadowed by the preceding module

fn main() { core::f(); }
```
This is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by removing colliding `extern crate` declarations, which are shadowed and hence unused.
@bors bors merged commit 834fb17 into rust-lang:master Jan 11, 2016
@jseyfried jseyfried deleted the fix_extern_crate_duplicate branch February 11, 2017 01:29
@jseyfried jseyfried changed the title rustc_resolve: Fix bug in duplicate checking for extern crates. resolve: fix bug in duplicate checking for extern crates Feb 14, 2017
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.

8 participants