Skip to content

Fix clippy warnings on newer Rust toolchains - #38619

Merged
antiguru merged 1 commit into
MaterializeInc:mainfrom
antiguru:clippy-198-fixes
Sep 2, 2026
Merged

Fix clippy warnings on newer Rust toolchains#38619
antiguru merged 1 commit into
MaterializeInc:mainfrom
antiguru:clippy-198-fixes

Conversation

@antiguru

@antiguru antiguru commented Sep 2, 2026

Copy link
Copy Markdown
Member

CI derives its toolchain from the rust-version field in the root Cargo.toml, which pins 1.97.1. Warnings that newer toolchains introduce therefore go unreported until someone builds locally. This change clears everything that Rust 1.98 reports, plus the deprecations that the current nightly adds on top.

Rust 1.98 extends clippy::extra_unused_lifetimes to higher-ranked binders in where-clauses, which flags three for<'a> binders whose lifetime never appears in the bound they introduce. Removing the binder leaves the bounds unchanged, because the parenthesized Fn sugar already introduces a fresh lifetime for each elided reference. The same toolchain also reports two unused imports and three clippy::useless_format calls. parser_err! calls to_string on a single-expression argument, so passing the literal directly still produces an owned String.

Nightly additionally deprecates the legacy numeric constants and constructors. max_value and min_value become the MAX and MIN associated constants, and std::usize::MAX becomes usize::MAX. Dropping the use std::i64 import in the Avro decoder is what silences the two warnings on i64::MAX and i64::MIN, because that import made the path resolve to the deprecated module instead of the primitive type.

Two groups of nightly warnings are left alone. The fetch_update to try_update rename is too recent to use while CI builds with 1.97.1, and the overflow evaluating the requirement notices come from the new trait solver hitting its recursion limit rather than from a defect in this code.

Note that this change does not close the gap that hid these warnings. CI keeps building with 1.97.1, so the next lint a newer toolchain adds will go unreported the same way. Bumping rust-version rebuilds the CI builder image and raises the declared minimum supported version, which belongs in its own change.

Release notes

No user-visible changes.

🤖 Posted by Claude Code

CI derives its toolchain from the `rust-version` field in the root
`Cargo.toml`, which pins 1.97.1. Warnings that newer toolchains introduce
therefore go unreported until someone builds locally. This change clears
everything that Rust 1.98 reports, plus the deprecations that the current
nightly adds on top.

Rust 1.98 extends `clippy::extra_unused_lifetimes` to higher-ranked binders in
where-clauses, which flags three `for<'a>` binders whose lifetime never appears
in the bound they introduce. Removing the binder leaves the bounds unchanged,
because the parenthesized `Fn` sugar already introduces a fresh lifetime for
each elided reference. The same toolchain also reports two unused imports and
three `clippy::useless_format` calls; `parser_err!` calls `to_string` on a
single-expression argument, so passing the literal directly still produces an
owned `String`.

Nightly additionally deprecates the legacy numeric constants and constructors.
`max_value` and `min_value` become the `MAX` and `MIN` associated constants,
and `std::usize::MAX` becomes `usize::MAX`. Dropping the `use std::i64` import
in the Avro decoder is what silences the two warnings on `i64::MAX` and
`i64::MIN`, because that import made the path resolve to the deprecated module
instead of the primitive type.

Two groups of nightly warnings are left alone. The `fetch_update` to
`try_update` rename is too recent to use while CI builds with 1.97.1, and the
`overflow evaluating the requirement` notices come from the new trait solver
hitting its recursion limit rather than from a defect in this code.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antiguru
antiguru requested review from a team as code owners September 2, 2026 07:59

@ggevay ggevay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@antiguru
antiguru merged commit 4e012ea into MaterializeInc:main Sep 2, 2026
87 checks passed

antiguru commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review!

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.

2 participants