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

extern crate privacy is "public" without requiring "pub". #29654

Closed
eddyb opened this issue Nov 6, 2015 · 2 comments
Closed

extern crate privacy is "public" without requiring "pub". #29654

eddyb opened this issue Nov 6, 2015 · 2 comments
Assignees
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Nov 6, 2015

mod foo {
    extern crate std;
}

fn main() {
    println!("{}", foo::std::mem::size_of::<i32>());
}

Try on playpen.

This is due to is_public being true for all ItemExternCrate regardless of whether they are pub.

Even then, pub extern crate is not handled correctly in all cases, see #26775.

@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added the P-high High priority label Nov 12, 2015
@nikomatsakis nikomatsakis added T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed P-high High priority labels Nov 12, 2015
@nrc nrc self-assigned this Nov 12, 2015
@nrc
Copy link
Member

nrc commented Nov 16, 2015

I'm going to close this and discuss further on #26775 - the two issues are very connected and that issue has more discussion.

This is due to is_public being true for all ItemExternCrate regardless of whether they are pub.

This is not the case - is_public there is referring to the module itself, not the importing directive, so being true all the time is correct. More on #26775.

@nrc nrc closed this as completed Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants