Skip to content

Conversation

jseyfried
Copy link
Contributor

This PR stops non-import items from shadowing glob-imported re-exports (fixes #31337) and fixes the fallout in the standard libraries and tests.

Previously, it was possible to shadow a glob-imported re-export, so this a [breaking-chage]. For example,

mod foo {
    pub fn g() {}
    pub use self::g as f;
}

use foo::*; // This breaks, since the imported re-export conflicts with the following item.
fn f() {}

The breakage can be fixed by renaming the non-import item or by using single imports in place of the glob import.
r? @nrc

@jseyfried jseyfried force-pushed the disallow_shadowing branch 2 times, most recently from ae640ef to a118b6a Compare February 3, 2016 05:18
@nrc nrc added the S-waiting-on-crater Status: Waiting on a crater run to be completed. label Feb 3, 2016
@nrc
Copy link
Member

nrc commented Feb 3, 2016

cc @rust-lang/lang

@nrc nrc added I-nominated T-lang Relevant to the language team labels Feb 3, 2016
@retep998
Copy link
Contributor

retep998 commented Feb 3, 2016

Per my other comment here a crater run wouldn't notice breakages to projects that glob import winapi.

@petrochenkov
Copy link
Contributor

Yeah, the breakage looks bad (still would be interested to see crater results).

@bors
Copy link
Collaborator

bors commented Feb 11, 2016

☔ The latest upstream changes (presumably #31461) made this pull request unmergeable. Please resolve the merge conflicts.

@jseyfried jseyfried force-pushed the disallow_shadowing branch 3 times, most recently from 03d9c78 to 1ae0233 Compare February 11, 2016 08:10
@jseyfried
Copy link
Contributor Author

rebased

@nikomatsakis
Copy link
Contributor

Since we decided not to "fix" the current behavior, I believe this PR should be closed. Correct me if I am mistaken.

@jseyfried jseyfried deleted the disallow_shadowing branch March 25, 2016 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-crater Status: Waiting on a crater run to be completed. T-lang Relevant to the language team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Items shadow glob-imported reexports
6 participants