Reduce uniform field visibility together - #153
Merged
Merged
Conversation
charliermarsh
force-pushed
the
charlie/fix-uniform-field-visibility-ruff
branch
from
July 31, 2026 11:11
8373739 to
ab95fa1
Compare
charliermarsh
force-pushed
the
charlie/fix-uniform-field-visibility-ruff
branch
from
July 31, 2026 11:12
ab95fa1 to
c73a0a0
Compare
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.
Summary
Reduce complete, uniformly visible field groups together instead of suggesting different visibility levels for sibling fields.
When one
pub(crate)field can becomepub(super)and another can become private, we now reportpub(super)for both when the allow-by-defaulthawk::unnecessary_crate_visibilitylint is enabled. A field that requires the current visibility still preserves the group, while a complete group whose fields can all become private is reduced to private.Preserve the current visibility when a source field is absent from the compiled graph, such as a cfg-disabled field, or when a field opts out with
#[allow(dead_code)], because those groups cannot participate in a safe group-wide fix. This completeness flag changes the compiler-driver protocol from 9 to 10.Add graph-level and end-to-end fix regressions and update the configuration, architecture, and protocol documentation. The full test suite, Clippy, Rustfmt, Prettier, and a Ruff workspace run without its 13 temporary uniform-field overrides pass.