privacy: Type privacy lints fixes and cleanups#112670
Merged
bors merged 4 commits intorust-lang:masterfrom Jun 29, 2023
Merged
Conversation
Collaborator
|
r? @eholk (rustbot has picked a reviewer for you, use r? to override) |
Contributor
Author
|
cc @Bryanskiy |
This comment has been minimized.
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.
Contributor
Author
|
Ping @eholk, it's been 2 weeks. |
eholk
approved these changes
Jun 28, 2023
| 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) { |
Contributor
There was a problem hiding this comment.
Is the local visibility check just redundant because effective visibility is always stricter?
Contributor
Author
Contributor
|
@bors r+ |
Collaborator
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See individual commits.
Follow up to #111801.