-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Integrate privacy into field and method selection #31938
Conversation
9be5455
to
5d2e258
Compare
On Sat, Feb 27, 2016 at 01:23:08AM -0800, Jeffrey Seyfried wrote: you're on a roll! Just FYI I sat down over last few days to read over |
@nikomatsakis Ok, let me know if you'd like me to explain or comment anything! |
2f835d1
to
12a209b
Compare
Fixes #22684 |
@jseyfried you need to put that in the description. |
@eddyb I updated the description. |
4f16e1c
to
6166bd7
Compare
I rebased and added a commit that refactors away most of the privacy visitor. |
3ae768d
to
f2c3d11
Compare
☔ The latest upstream changes (presumably #32432) made this pull request unmergeable. Please resolve the merge conflicts. |
f2c3d11
to
228fd48
Compare
@jseyfried can you add some tests that show that the logic about private fields/methods is working? I was thinking it'd be nice to have a test where the private field appears in an outer deref. In other words, if the autoderef chain of types is r=me with such a test. |
fn f(bar: foo::Bar, baz: foo::Baz) { | ||
let _ = bar.i; | ||
let _ = baz.0; | ||
let _ = bar.f(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you convert this to a run-pass test and somehow check the return value of f
, so that we know the right function is being called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
Sorry, let me clarify my previous comment. I'd like to see two things:
|
228fd48
to
67b39f8
Compare
67b39f8
to
48c20b0
Compare
Done.
Private inherent methods are tested in I believe these tests are sufficient to check the logic you referenced, but if you want I can add a |
@jseyfried I'll leave it to your judgement. I certainly lean towards more exhaustive testing but there is no reason to add duplicate tests either. R=me either way. |
Ok, thanks for reviewing! @bors r=nikomatsakis |
📌 Commit 48c20b0 has been approved by |
⌛ Testing commit 48c20b0 with merge 4f46ecb... |
💔 Test failed - auto-mac-32-opt |
@bors retry |
@bors: retry force clean |
@bors: retry force clean maybe second time's the charm? |
This PR integrates privacy checking into field and method selection so that an inaccessible field/method cannot stop an accessible field/method from being used (fixes #12808 and fixes #22684).
r? @eddyb