chore - Bump MSRV/toolchain to stable 1.93 and fix strict clippy#530
chore - Bump MSRV/toolchain to stable 1.93 and fix strict clippy#530mingley wants to merge 1 commit intotikv:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughBump Rust toolchain to 1.93.0 and add crate-level/clippy allowances; adjust error enum to take a plain Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Addressed local review findings #2 and #3 in
Also added a dedicated "Follow-on PR Callout: Dependency Modernization" section to the PR description with major version gaps and rationale. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/common/errors.rs`:
- Around line 202-211: The test grpc_api_variant_accepts_tonic_status_payload is
gated with #[cfg(not(clippy))], causing it to be skipped under cargo clippy;
remove the #[cfg(not(clippy))] attribute so the test always runs, and ensure it
still passes after applying the unconditional boxing change mentioned in the
surrounding comments (the test constructs Error::GrpcAPI from tonic::Status and
asserts status.code() and status.message()).
- Around line 11-14: The conditional type alias GrpcApiErrorPayload causes
divergent in-memory representations under clippy vs normal builds; make the
payload unconditionally boxed by changing the alias to "type GrpcApiErrorPayload
= Box<tonic::Status>;" so Error::GrpcAPI has a consistent, smaller enum variant
across all builds, then remove the #[cfg(not(clippy))] gating from tests that
construct Error::GrpcAPI (the test that conditionally constructs GrpcAPI can now
use Error::GrpcAPI(status) directly) and consider removing the now-redundant
#[allow(clippy::large_enum_variant)] if no longer needed.
0a5504c to
98a9dcb
Compare
98a9dcb to
affc0d5
Compare
Signed-off-by: Michael Ingley <michael.ingley@gmail.com>
affc0d5 to
d63fe2b
Compare
Summary
This PR upgrades the repository toolchain/MSRV to Rust
1.93.0and applies strict-clippy compatibility fixes while preserving runtime behavior and public API compatibility.Quality objective:
-D warnings,Error::GrpcAPIusability for downstream code.Rationale
Problem statement
Moving to Rust 1.93 and strict clippy surfaced new lints in generated/protocol and request/transaction paths. A prior approach introduced awkward conditional typing for
Error::GrpcAPI; this PR keeps the API representation stable and solves lint pressure in a clearer way.Design changes
Cargo.toml:rust-version = "1.93.0"rust-toolchain.toml: channel1.93.0Error::GrpcAPIcompatibility:tonic::Status(single representation),From<tonic::Status> for Errorconversion path,cfg(clippy)payload-type split.#![allow(clippy::result_large_err)]insrc/lib.rsandexamples/raw.rs.repeat(...).take(...)withrepeat_n(...),src/proto.rs.Risk analysis
File Scope
Cargo.tomlrust-toolchain.tomlsrc/common/errors.rssrc/lib.rsexamples/raw.rssrc/proto.rssrc/pd/retry.rssrc/store/request.rssrc/transaction/requests.rssrc/transaction/transaction.rstests/integration_tests.rsTesting Done
Executed locally:
cargo fmt-> passcargo clippy --all-targets --all-features -- -D warnings-> passcargo test-> passAdded/maintained regression coverage in
src/common/errors.rs:from_tonic_status_produces_grpc_api_errorgrpc_api_variant_accepts_tonic_status_payloadfrom_proto_region_error_wraps_region_errorfrom_proto_key_error_wraps_key_errorCompatibility
Error::GrpcAPIconstruction/pattern behavior remains compatible (tonic::Statuspayload).Summary by CodeRabbit
Chores
Improvements
Tests