More workspace lints: finish [workspace.lints.rust] - #10551
Merged
Conversation
emilk
marked this pull request as ready for review
August 4, 2026 19:10
Jefffrey
reviewed
Aug 4, 2026
Removes casts where the source and target types are identical, e.g. `u64 as u64`. Two macro bodies keep the cast (it is only trivial for some of their instantiations) and get a scoped `#[allow]`.
No violations: `unexpected_cfgs` is already warn-by-default, so this only records the workspace policy explicitly.
Drops an unused lifetime parameter from `binary_apply`. The 49 violations in the flatbuffers-generated `arrow-ipc/src/gen/` modules are allowed in `gen/mod.rs`, which `regen.sh` leaves alone.
All violations were leftover `extern crate` statements in benches and examples, which edition 2018 and later do not need. Applied with `cargo clippy --fix`.
`elided_lifetimes_in_paths` has to be allowed explicitly since it is part of `rust_2018_idioms`; `trivial_casts` and `unused_qualifications` are `allow` by default and are listed only to record the decision.
All 41 violations are in the flatbuffers-generated `arrow-ipc/src/gen/` modules, so they are allowed in `gen/mod.rs`, which `regen.sh` leaves alone. No hand-written code needed changing.
`expect` fails if the lint stops firing, so these cannot silently go stale. `bit_util.rs` could not use `expect`: its `from_bitpacked!` macro is instantiated for four types and the cast is only trivial for `u64`, so the expectation was unfulfilled for the other three. `u64` is now written out by hand without a cast, which removes the need for any attribute.
`clippy::collapsible_if` is deny-by-default in CI and has been failing on `main` since apache#10409; the nested `if let` is now a let-chain.
Jefffrey
approved these changes
Aug 5, 2026
Contributor
|
thanks @emilk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No issue in particular
Rationale for this change
#10533 added
[workspace.lints]with a minimal set of lints.This fills out
[workspace.lints.rust]with more lints.What changes are included in this PR?
Best reviewed commit by commit!
Are these changes tested?
By CI
Are there any user-facing changes?
No public API changed.