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 up`extern crate` is always treated as `pub` within the crate, but is not visible outside it; `pub extern crate` makes no difference #26775
Comments
brson
added
I-wrong
A-parser
I-nominated
T-lang
labels
Jul 4, 2015
This comment has been minimized.
This comment has been minimized.
|
Also see #21757. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high We should nail this down. I'm assigning this to @nrc since iirc he last touched the privacy code. ;) |
rust-highfive
added
P-high
and removed
I-nominated
labels
Jul 9, 2015
nikomatsakis
assigned
nrc
Jul 9, 2015
This comment has been minimized.
This comment has been minimized.
|
(any reason we can't just ... make Update: (with a warning cycle in the release series, of course) Update 2: Hmm, I guess I missed the point that it can also be reexported, so making |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix Making it illegal might still be a reasonable stop-gap if it looks like we won't fix the problem for a while. |
nrc
added a commit
to nrc/rust
that referenced
this issue
Sep 18, 2015
bors
added a commit
that referenced
this issue
Sep 19, 2015
brson
added a commit
to brson/rust
that referenced
this issue
Oct 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Can this be made into a hard error on nightly now? |
This comment has been minimized.
This comment has been minimized.
|
Should we do a crater run? (with this marked as error) Advice: if we do, please only make it an error if cap-lints is not provided. |
This comment has been minimized.
This comment has been minimized.
|
This has reached stable now, so I'd at least be fine going to a hard error! (pending crater) |
eddyb
referenced this issue
Nov 6, 2015
Closed
extern crate privacy is "public" without requiring "pub". #29654
This comment has been minimized.
This comment has been minimized.
|
See #29654 for a more breakage-prone issue with |
nrc
changed the title
'pub extern crate' is accepted and behaves badly
`extern crate` is always treated as `pub` within the crate, but is not visible outside it; `pub extern crate` makes no difference
Nov 16, 2015
nrc
added
A-resolve
A-visibility
and removed
A-parser
labels
Nov 16, 2015
This comment has been minimized.
This comment has been minimized.
|
I was looking at this today. Let me get specific with the issues:
The RFC is a little vague - it states that So, I thought, lets make
If It seems the best solution is to treat Alternatively, we could probably leave things as is for now, perhaps carry on with the plan to make cc @petrochenkov since he has been looking at privacy. |
This comment has been minimized.
This comment has been minimized.
|
and cc @rust-lang/lang |
This comment has been minimized.
This comment has been minimized.
|
@nrc for what it's worth, the semantic I intended in the RFC was formulated under the wrong assumption that private Since I see that aspect of Some background: |
This comment has been minimized.
This comment has been minimized.
|
@nrc and I discussed a bit today. My feeling is that:
|
nikomatsakis
closed this
Nov 16, 2015
jseyfried
added a commit
to jseyfried/rust
that referenced
this issue
Jan 24, 2016
jseyfried
referenced this issue
Jan 24, 2016
Merged
rustc_resolve: Refactor away NameBindings and ImportResolutionPerNamespace #30843
jseyfried
added a commit
to jseyfried/rust
that referenced
this issue
Jan 26, 2016
This comment has been minimized.
This comment has been minimized.
|
I’ve been using this pattern to simulate pub mod tendril {
extern crate tendril;
pub use tendril::*;
} |
brson commentedJul 4, 2015
Two examples:
That is accepted but
corecannot be accessed from outside the crate.That is accepted and reexports
core.In other words,
extern crateis always public to other modules, but can never be made public to other crates.There are no tests for
pub extern crateso I suspect this is not intentional.