-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't warn on fields in the unreachable_pub
lint
#126040
Conversation
This comment has been minimized.
This comment has been minimized.
2e2b3b3
to
0156e08
Compare
One issue with not linting on fields of I wonder if in those cases we should not lint on the fields? or maybe downgrade from |
When checking fields we already know whether the lint was reported for the struct or not. |
Hmm, should we ever check fields at all?
It seems like the whole |
0156e08
to
89d86ae
Compare
@bors r+ |
pub
fields of pub(restricted)
structsunreachable_pub
lint
… r=petrochenkov Don't warn on fields in the `unreachable_pub` lint This PR restrict the `unreachable_pub` lint by not linting on `pub` fields of `pub(restricted)` structs and unions. This is done because that can quickly clutter the code for an uncertain value, in particular since the "real" visibility is defined by the parent (the struct it-self). This is meant to address one of the last concern of the `unreachable_pub` lint. r? `@petrochenkov`
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#125606 (Size optimize int formatting) - rust-lang#125724 (Uplift `Relate`/`TypeRelation` into `rustc_next_trait_solver`) - rust-lang#126040 (Don't warn on fields in the `unreachable_pub` lint ) - rust-lang#126065 (mark binding undetermined if target name exist and not obtained) - rust-lang#126098 (Remove `same-lib-two-locations-no-panic` run-make test) - rust-lang#126099 (Crate loader cleanups) - rust-lang#126101 (Revert "Disallow ambiguous attributes on expressions" on nightly) - rust-lang#126103 (Improve Docs for `hir::Impl` and `hir::ImplItem`) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 7 pull requests Successful merges: - rust-lang#125606 (Size optimize int formatting) - rust-lang#125724 (Uplift `Relate`/`TypeRelation` into `rustc_next_trait_solver`) - rust-lang#126040 (Don't warn on fields in the `unreachable_pub` lint ) - rust-lang#126098 (Remove `same-lib-two-locations-no-panic` run-make test) - rust-lang#126099 (Crate loader cleanups) - rust-lang#126101 (Revert "Disallow ambiguous attributes on expressions" on nightly) - rust-lang#126103 (Improve Docs for `hir::Impl` and `hir::ImplItem`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126040 - Urgau:unreachable_pub-fields-less, r=petrochenkov Don't warn on fields in the `unreachable_pub` lint This PR restrict the `unreachable_pub` lint by not linting on `pub` fields of `pub(restricted)` structs and unions. This is done because that can quickly clutter the code for an uncertain value, in particular since the "real" visibility is defined by the parent (the struct it-self). This is meant to address one of the last concern of the `unreachable_pub` lint. r? ``@petrochenkov``
This PR restrict the
unreachable_pub
lint by not linting onpub
fields ofpub(restricted)
structs and unions. This is done because that can quickly clutter the code for an uncertain value, in particular since the "real" visibility is defined by the parent (the struct it-self).This is meant to address one of the last concern of the
unreachable_pub
lint.r? @petrochenkov