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

privacy: Type privacy lints fixes and cleanups #112670

Merged
merged 4 commits into from Jun 29, 2023
Merged

Conversation

petrochenkov
Copy link
Contributor

See individual commits.
Follow up to #111801.

@rustbot
Copy link
Collaborator

rustbot commented Jun 15, 2023

r? @eholk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 15, 2023
@petrochenkov
Copy link
Contributor Author

cc @Bryanskiy

@rust-log-analyzer

This comment has been minimized.

Use a boolean constant parameter instead.

Also turn some methods on `DefIdVisitor` into associated constants.
…ility

This commit reverts a change made in rust-lang#111425.
It was believed that this change was necessary for implementing type privacy lints, but rust-lang#111801 showed that it was not necessary.
Quite opposite, the revert fixes some issues.
@petrochenkov
Copy link
Contributor Author

Ping @eholk, it's been 2 weeks.
The feature gating part should land before the next release.

Copy link
Contributor

@eholk eholk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the slow review! Thanks for breaking this out into different commits, that made it much easier to review.

@bors r+

if !(cx.effective_visibilities.is_reachable(item.owner_id.def_id)
&& cx.tcx.local_visibility(item.owner_id.def_id).is_public())
{
if !cx.effective_visibilities.is_reachable(item.owner_id.def_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the local visibility check just redundant because effective visibility is always stricter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with 95a24c6 reachable to other crates implies pub again, so we revert various "adaptation" changes from #111801 too.

@eholk
Copy link
Contributor

eholk commented Jun 28, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jun 28, 2023

📌 Commit 98a86ff has been approved by eholk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 29, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#112670 (privacy: Type privacy lints fixes and cleanups)
 - rust-lang#112929 (Test that we require implementing trait items whose bounds don't hold in the current impl)
 - rust-lang#113054 (Make `rustc_on_unimplemented` std-agnostic)
 - rust-lang#113137 (don't suggest `move` for borrows that aren't closures)
 - rust-lang#113139 (style-guide: Clarify let-else further)
 - rust-lang#113140 (style-guide: Add an example of formatting a multi-line attribute)
 - rust-lang#113143 (style-guide: Narrow guidance about references and dereferencing)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 42a495d into rust-lang:master Jun 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants