Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upresolve: fix the visibility of extern crates #31362
Conversation
rust-highfive
assigned
nrc
Feb 2, 2016
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
from
eb4e401
to
794df1d
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It doesn't necessarily have to be a hard error immediately, you can mark such reexports with |
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
2 times, most recently
from
9d5ef32
to
9f6dd8e
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@petrochenkov Good point, I added another commit making it a warning. |
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
6 times, most recently
from
cce80e7
to
2168764
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
nrc
added
the
S-waiting-on-crater
label
Feb 3, 2016
nrc
reviewed
Feb 3, 2016
| if name_binding.is_extern_crate() { | ||
| let msg = format!("extern crate `{}` is private, and cannot be reexported \ | ||
| (error E0364), consider declaring with `pub`", | ||
| source); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nrc
reviewed
Feb 3, 2016
|
|
||
| mod foo { | ||
| extern crate core; | ||
| pub use self::core as reexported_core; // Check that private extern crates can be reexported |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
petrochenkov
Feb 3, 2016
Contributor
The private_in_public warning is reported during lint pass, much later than resolve.
It looks like it's tested separately in private-variant-and-crate-reexport.rs.
This comment has been minimized.
This comment has been minimized.
|
The PR lgtm. I'll wait for a crater run and for the lang team to see this before giving r+ though. |
This comment has been minimized.
This comment has been minimized.
|
Seems to match our previous decision on this question, so LGTM as well. |
petrochenkov
reviewed
Feb 3, 2016
| @@ -68,6 +68,7 @@ extern crate serialize as rustc_serialize; // used by deriving | |||
| #[cfg(test)] | |||
| extern crate test; | |||
|
|
|||
| #[allow(private_in_public)] | |||
This comment has been minimized.
This comment has been minimized.
petrochenkov
Feb 3, 2016
Contributor
Is pub extern crate very buggy? I think it can be used here instead of suppressing the warning. It will report the "pub extern crate does not work as expected" warning during stage0, but that's ok.
This comment has been minimized.
This comment has been minimized.
jseyfried
Feb 4, 2016
Author
Contributor
Good point, for some reason I thought that the warnings weren't ok.
pub extern crate works fine except that it is not visible to other crates (before this PR).
This comment has been minimized.
This comment has been minimized.
|
|
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
from
73e8496
to
f722e31
Feb 5, 2016
This comment has been minimized.
This comment has been minimized.
|
This also closes #22146. |
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
from
f722e31
to
44d605c
Feb 6, 2016
This comment has been minimized.
This comment has been minimized.
|
|
jseyfried
force-pushed the
jseyfried:fix_extern_crate_visibility
branch
2 times, most recently
from
ea0b0d5
to
3acbd2f
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@brson or @alexcrichton could we get a crater run for this PR please? |
bors
added a commit
that referenced
this pull request
Feb 25, 2016
This comment has been minimized.
This comment has been minimized.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Feb 25, 2016
Manishearth
closed this
Feb 25, 2016
Manishearth
reopened this
Feb 25, 2016
bors
added a commit
that referenced
this pull request
Feb 25, 2016
bors
added a commit
that referenced
this pull request
Feb 25, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Feb 25, 2016
bors
added a commit
that referenced
this pull request
Feb 25, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors: retry On Thu, Feb 25, 2016 at 12:28 AM, bors notifications@github.com wrote:
|
jseyfried commentedFeb 2, 2016
This PR changes the visibility of extern crate declarations to match that of items (fixes #26775).
To avoid breakage, the PR makes it a
public_in_privatelint to reexport a private extern crate, and it adds the lintinaccessible_extern_cratefor uses of an inaccessible extern crate.The lints can be avoided by making the appropriate
extern cratedeclaration public.