Skip to content

style(body,proto): enforce clippy::rest_pattern_accessible_field - #4230

Open
cratelyn wants to merge 1 commit into
masterfrom
kate/rest-pattern-accessible-field
Open

cratelyn wants to merge 1 commit into
masterfrom
kate/rest-pattern-accessible-field

Conversation

@cratelyn

@cratelyn cratelyn commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

see #4071.

see https://rust-lang.github.io/rust-clippy/master/index.html#rest_pattern_accessible_field.

this lint disallows .. patterns for accessible fields. this is helpful
because it calls attention to locations that may need to be updated when
the contents of a structure changes.

allowances are left in place for simple accessors. because the
lint_reason feature is not supported across the range of our MSRV, we
use /*reason: explanation*/ comments for now.

an explicit allowance of unneeded_field_pattern is added, because
these two lints conflict: we can either expect exhaustive matching, or
we can expect that no fields are explicitly ignored. the former is more
verbose, but draws attention to where logic may need to be updated as a
type evolves over time.

see #4071.

see <https://rust-lang.github.io/rust-clippy/master/index.html#rest_pattern_accessible_field>.

this lint disallows `..` patterns for accessible fields. this is helpful
because it calls attention to locations that may need to be updated when
the contents of a structure changes.

allowances are left in place for simple accessors. because the
lint_reason feature is not supported across the range of our MSRV, we
use `/*reason: explanation*/` comments for now.

an explicit allowance of `unneeded_field_pattern` is added, because
these two lints conflict: we can either expect exhaustive matching, or
we can expect that no fields are explicitly ignored. the former is more
verbose, but draws attention to where logic may need to be updated as a
type evolves over time.

Signed-off-by: katelyn martin <git@katelyn.world>
@cratelyn
cratelyn marked this pull request as ready for review October 10, 2026 04:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant