mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
174a0d7be6
feature: add new lint `pub_underscore_fields` fixes: #10282 This PR introduces a new lint `pub_underscore_fields` that lints when a user has marked a field of a struct as public, but also prefixed it with an underscore (`_`). This is something users should avoid because the two ideas are contradictory. Prefixing a field with an `_` is inferred as the field being unused, but making a field public infers that it will be used. - \[x] Followed [lint naming conventions][lint_naming] - I believe I followed the naming conventions, more than happy to update the naming if I did not :) - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- changelog: new lint: [`pub_underscore_fields`] [#10283](https://github.com/rust-lang/rust-clippy/pull/10283) <!-- changelog_checked --> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |