Conversation
052a460 to
0fae774
Compare
|
Lintcheck changes for 801a92f
This comment will be updated if you push new changes |
|
r? @dswij rustbot has assigned @dswij. Use Why was this reviewer chosen?The reviewer was selected based on:
|
0533a7b to
4c078e7
Compare
|
r? clippy |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dc467f9 to
12e7dab
Compare
This comment has been minimized.
This comment has been minimized.
12e7dab to
5eb8f76
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- `impl_lint_pass` moved from `rustc_session` to `rustc_lint` - Regenerate `book/src/lint_configuration.md` (`cargo bless --test config-metadata`) - Dogfood the lint in `needless_range_loop::SpanlessExpr`
Required by the `lint-attributes-organization` test.
5eb8f76 to
801a92f
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
👋🏻 Triage here. We have recently adopted an new policy regarding LLM use. Concretely regarding your PR
We hold LLM based contributions to an higher standard than human contributions. |
|
Reminder, once the PR becomes ready for a review, use |
|
Error: Failed to set assignee to
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
New lint: [
use_destructuring]Adds a
pedanticlint that suggests using destructuring when a function accesses all fields of a struct via theselfparameter (e.g.self.x,self.y,self.z), and the struct has 3 or more fields. This helps keep code in sync with struct definitions — the compiler will error on the destructuring if a field is added.Works for both named structs and tuple structs.
Configuration
Two options in
clippy.toml:use-destructuring-min-fieldsu643use-destructuring-scope"self"use-destructuring-scopevalues:"self"selfparameter (default, most conservative)."Self"Selfin the enclosing impl block."crate""*"Suppression
The lint does NOT fire when:
self.x = 5).#[non_exhaustive].Example
.stderrfile)cargo testpasses locallycargo dev update_lintscargo dev fmtchangelog: [
use_destructuring]: newpedanticlint suggesting destructuring when all fields of a struct are accessed individuallyImplemented with a lot of help from Claude Code