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

pub extern crate foo; doesn't work #21757

Closed
bvssvni opened this issue Jan 29, 2015 · 7 comments
Closed

pub extern crate foo; doesn't work #21757

bvssvni opened this issue Jan 29, 2015 · 7 comments
Labels
A-resolve Area: Name resolution

Comments

@bvssvni
Copy link

bvssvni commented Jan 29, 2015

pub extern crate foo;

vs

extern crate "foo" as foo_lib;
pub use foo_lib as foo;

The second version works with piston but the first one doesn't. Tested by overriding dependency locally with the image example in Piston.

cc @eddyb @Kimundi

@sfackler
Copy link
Member

I thought we disallowed pub extern crate entirely?

@Kimundi
Copy link
Member

Kimundi commented Jan 30, 2015

See rust-lang/rfcs#385

@frewsxcv
Copy link
Member

frewsxcv commented Jun 9, 2015

So should the pub actually have any effect? From my experiences this is still an issue (adding pub doesn't publicize the external crate)

@Kimundi
Copy link
Member

Kimundi commented Jun 9, 2015

It should have the effect of making the extern crate item externally reachable from the module.

@frewsxcv
Copy link
Member

frewsxcv commented Jun 9, 2015

Oh, I guess that makes sense. I originally thought that adding a pub would make it visible outside the module in addition to inside.

It might be nice if there was a section in the docs about the pub prefix for extern crate

https://doc.rust-lang.org/stable/reference.html#extern-crate-declarations

@yberreby
Copy link

This just bit me, the pub should behave as expected or not compile.

@nrc
Copy link
Member

nrc commented Sep 18, 2015

dup of #26775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

7 participants