-
Notifications
You must be signed in to change notification settings - Fork 13k
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
privacy exposure bug when struct has field(s) *and* an impl #10545
Labels
A-visibility
Area: Visibility / privacy
Comments
(The fact that the error messages are different is a little bit of a red flag to me.) |
Agreed, something funky is going on here. |
As mentioned in #10548, I believe that this is all a similar bug as this program: mod a {
struct S;
impl S { }
}
fn foo(_: a::S) {
}
fn main() {} This should not compile, but it does. |
bors
added a commit
that referenced
this issue
Dec 18, 2013
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
niftynif
added a commit
to niftynif/rust
that referenced
this issue
Dec 26, 2013
Wrote some tests for the compare/clone/to_str methods. Took out doc comments around tests. Don't allow impls to force public types This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes rust-lang#10545 Committing to show work in progress. Everything is still messy, but I want to take this opportunity to get feedback from relevant parties if I can. Recommitting after a bad commit that unnecessarily changed files.
niftynif
added a commit
to niftynif/rust
that referenced
this issue
Dec 30, 2013
Wrote some tests for the compare/clone/to_str methods. Took out doc comments around tests. Don't allow impls to force public types This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes rust-lang#10545 Committing to show work in progress. Everything is still messy, but I want to take this opportunity to get feedback from relevant parties if I can. Recommitting after a bad commit that unnecessarily changed files.
niftynif
added a commit
to niftynif/rust
that referenced
this issue
Dec 30, 2013
Wrote some tests for the compare/clone/to_str methods. Took out doc comments around tests. Don't allow impls to force public types This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes rust-lang#10545 Committing to show work in progress. Everything is still messy, but I want to take this opportunity to get feedback from relevant parties if I can. Recommitting after a bad commit that unnecessarily changed files.
niftynif
added a commit
to niftynif/rust
that referenced
this issue
Jan 4, 2014
Wrote some tests for the compare/clone/to_str methods. Took out doc comments around tests. Don't allow impls to force public types This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes rust-lang#10545 Committing to show work in progress. Everything is still messy, but I want to take this opportunity to get feedback from relevant parties if I can. Recommitting after a bad commit that unnecessarily changed files. Added more robust compare and equals for Branch and Leaf, as well as some style changes. Cleanup: removing features that aren't needed, and removing lines that were eventually commented out anyway. Cleaning up whitespace errors. Undoing accidental deletion of file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was fun one for isolating the parameters where it does and does not occur.
The code (
a.rs
):So,
S
is notpub
ina
, so it should not be possible to access it frommain
.But, out of the box, the above compiles and runs:
If you remove either the payload or the impl, the privacy checker will flag an error:
The text was updated successfully, but these errors were encountered: