rust/clippy_config
bors 174a0d7be6 Auto merge of #10283 - ParkMyCar:lint/pub_underscore_fields, r=blyxyas
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 -->
2023-12-29 10:52:00 +00:00
..
src Auto merge of #10283 - ParkMyCar:lint/pub_underscore_fields, r=blyxyas 2023-12-29 10:52:00 +00:00
Cargo.toml Bump Clippy version -> 0.1.77 2023-12-28 19:21:01 +01:00