Skip to content

chore - Bump MSRV/toolchain to stable 1.93 and fix strict clippy#530

Open
mingley wants to merge 2 commits intotikv:masterfrom
mingley:mingley/bump-rust-version-1-93
Open

chore - Bump MSRV/toolchain to stable 1.93 and fix strict clippy#530
mingley wants to merge 2 commits intotikv:masterfrom
mingley:mingley/bump-rust-version-1-93

Conversation

@mingley
Copy link

@mingley mingley commented Feb 6, 2026

Summary

This PR bumps the repo to Rust 1.93.0 and applies the minimal, behavior-preserving fixes required to keep strict linting clean.

Detailed, file-by-file changes:

  1. Cargo.toml
  • Added rust-version = "1.93.0" under [package].
  • Why: declare the current minimum supported Rust version explicitly.
  1. rust-toolchain.toml
  • Changed toolchain channel from 1.84.1 to 1.93.0.
  • Why: align pinned toolchain with the declared rust-version.
  1. src/common/errors.rs
  • Changed Error::GrpcAPI payload from tonic::Status to Box<tonic::Status>.
  • Added explicit impl From<tonic::Status> for Error that boxes the status.
  • Why: remove the need for broad clippy::result_large_err allowances while preserving existing conversion ergonomics for ?.
  1. src/store/request.rs
  • Updated .map_err(Error::GrpcAPI) to .map_err(Error::from).
  • Why: match the boxed GrpcAPI constructor while keeping behavior unchanged.
  1. src/proto.rs
  • Added module-level #[allow(dead_code)] on mod protos.
  • Added explicit context comments:
    • Rust 1.93 clippy::all now flags many protobuf-generated wire types as dead code.
    • Prior 1.84.1 toolchain did not fail on these generated definitions.
  • Why: keep the suppression narrowly scoped to generated proto modules and document why it is needed now.
  1. src/pd/retry.rs
  • Simplified map(|resp| resp.stores.into_iter().map(Into::into).collect()) to map(|resp| resp.stores).
  • Why: remove a redundant conversion flagged by stricter clippy.
  1. src/transaction/requests.rs
  • Replaced iter::repeat(...).take(len) with iter::repeat_n(..., len).
  • Simplified self.keys = shard.into_iter().map(Into::into).collect(); to self.keys = shard;.
  • Removed redundant .map(Into::into) when merging lock responses.
  • Why: eliminate manual_repeat_n and useless_conversion lints without changing runtime behavior.
  1. src/transaction/transaction.rs
  • Simplified .map(|r| r.into_iter().map(Into::into).collect()) to .map(|r| r.into_iter().collect()) in both affected execution paths.
  • Why: remove redundant conversion paths flagged by clippy.
  1. tests/integration_tests.rs
  • Replaced iter::repeat(vec![]..).take(batch_num) with iter::repeat_n(vec![].., batch_num).
  • Why: fix manual_repeat_n lint in tests under stricter clippy.

Testing Done

Executed locally on branch mingley/bump-rust-version-1-93:

  1. make check
  • Includes:
    • cargo run -p tikv-client-proto-build
    • cargo check --all --all-targets --features "integration-tests"
    • cargo fmt -- --check
    • cargo clippy --all-targets --features "integration-tests" -- -D clippy::all
  • Result: pass.
  1. cargo nextest run --config-file $(pwd)/config/nextest.toml --all --no-default-features
  • Result: pass.
  • Summary: 53 passed, 0 skipped.

Follow-on PR Callout: Dependency Modernization

This PR intentionally limits scope to toolchain + lint compatibility. A dedicated follow-on PR should upgrade stale dependencies in controlled waves.

Major gaps from cargo +1.93.0 outdated -R --depth 1:

  • tonic: 0.10.2 -> 0.14.3
  • prost: 0.12.6 -> 0.14.3
  • thiserror: 1.0.69 -> 2.0.18
  • rand: 0.8.5 -> 0.9.2
  • prometheus: 0.13.4 -> 0.14.0
  • async-recursion: 0.3.2 -> 1.1.1
  • Dev/tooling: clap 2.34.0 -> 4.5.57, env_logger 0.10.2 -> 0.11.8, proptest-derive 0.5.1 -> 0.8.0, rstest 0.18.2 -> 0.26.1, serial_test 0.5.1 -> 3.3.1, reqwest 0.11.27 -> 0.13.1

Why this matters:

  • Security/maintenance exposure increases on stale major versions.
  • Ecosystem compatibility with modern tonic/prost APIs is deferred debt.
  • Duplicate dependency trees (notably multiple HTTP/rand stacks) increase compile and maintenance cost.

Recommended follow-on sequence:

  1. Upgrade transport stack (tonic/prost) in isolation.
  2. Upgrade core error/runtime deps (thiserror, rand, async-recursion, prometheus).
  3. Upgrade dev/test/tooling deps.
  4. Keep each wave green with make check + nextest before moving forward.

Signed-off-by: Michael Ingley <mingley@linkedin.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign you06 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Feb 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@mingley has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2026
@mingley
Copy link
Author

mingley commented Feb 6, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Michael Ingley <mingley@linkedin.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2026
@mingley
Copy link
Author

mingley commented Feb 6, 2026

Addressed local review findings #2 and #3 in cfad559:

  • Removed crate-wide/example clippy::result_large_err suppressions.
  • Replaced Error::GrpcAPI(tonic::Status) with boxed storage + explicit From<tonic::Status> so API signatures remain unchanged while reducing error size pressure.
  • Dropped generated-file rewrite logic from proto-build/src/main.rs.
  • Moved dead-code suppression to generated module boundary in src/proto.rs with explicit “why now vs before” context comment.

Also added a dedicated "Follow-on PR Callout: Dependency Modernization" section to the PR description with major version gaps and rationale.

@mingley mingley changed the title Bump MSRV/toolchain to stable 1.93 and fix strict clippy chore - Bump MSRV/toolchain to stable 1.93 and fix strict clippy Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant