Skip to content

Upgrade Rust toolchain to 1.95 and fix clippy lints#1259

Draft
harsha-simhadri wants to merge 1 commit into
mainfrom
users/harshasi/rust-1.95
Draft

Upgrade Rust toolchain to 1.95 and fix clippy lints#1259
harsha-simhadri wants to merge 1 commit into
mainfrom
users/harshasi/rust-1.95

Conversation

@harsha-simhadri

Copy link
Copy Markdown
Contributor

Summary

Bumps the pinned Rust toolchain from 1.92 → 1.95 and fixes the clippy warnings that surface under 1.95. All CI clippy jobs run with -Dwarnings, so each warning is a hard failure.

Changes

  • rust-toolchain.toml: channel = "1.92""1.95". CI reads the channel via rustup show, so no workflow edits are needed.
  • Clippy fixes (all three CI configs — default, all-features, and per-crate no-default-features — pass clean):
    • useless_conversion: removed redundant .into_iter() calls in diskann-benchmark-runner, diskann-benchmark, diskann-disk, and diskann-wide test helpers (plus the follow-up unused_parens / rustfmt reflow they triggered).
    • collapsible_match: folded the nested is_trained() check into a match guard in GarnetProvider::train_quantizer. Written as Some(q) if !q.is_trained() => q, _ => return false to stay exhaustive (clippy's own --fix produced a non-exhaustive match).
    • manual_checked_ops: added a targeted #[allow] + comment on DiskSectorGraph::node_sector_index. The else branch is genuine multi-sector-per-node layout logic, not a divide-by-zero guard, so checked_div would be semantically wrong.
  • agents.md: refreshed the toolchain reference to 1.95.

Validation (local, under 1.95)

  • cargo clippy with -Dwarnings — default features, all features, and per-crate no-default-features: 0 warnings.
  • cargo fmt --all --check: clean.
  • --locked (Cargo.lock): unchanged.
  • Tests for all changed crates pass (e.g. diskann-garnet 40/40).

Notes

The SDE baseline/AVX-512, codecov, and CodeQL gates aren't reproducible on Windows locally and are left to CI; the diff is lint-only, so risk is low.

Bump the pinned toolchain from 1.92 to 1.95 and resolve the clippy
warnings that surface under 1.95 (all CI clippy jobs run with -Dwarnings):

- useless_conversion: drop redundant .into_iter() calls in the benchmark,
  disk, and wide test helpers.
- collapsible_match: fold the nested trained-check into a match guard in
  the Garnet provider's train_quantizer.
- manual_checked_ops: allow the false positive in
  DiskSectorGraph::node_sector_index, where the else branch is genuine
  multi-sector layout logic rather than a divide-by-zero guard.

Also refresh the toolchain reference in agents.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c751fafd-79be-47e2-9f20-7f1934f4d6e7

Copilot AI 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.

Pull request overview

This PR updates the repository’s pinned Rust toolchain from 1.92 to 1.95 and applies small, targeted code changes to eliminate clippy warnings that become hard CI failures under -Dwarnings.

Changes:

  • Bump rust-toolchain.toml channel to Rust 1.95.
  • Remove a handful of redundant .into_iter() calls to satisfy useless_conversion / related clippy warnings.
  • Add a narrowly scoped clippy allow + rationale for clippy::manual_checked_ops in DiskSectorGraph::node_sector_index.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rust-toolchain.toml Pins the workspace toolchain to Rust 1.95.
diskann-wide/src/test_utils/dot_product.rs Removes redundant iterator conversions in test dot-product computations.
diskann-garnet/src/provider.rs Simplifies quantizer selection logic using a match guard to satisfy clippy.
diskann-disk/src/search/provider/disk_sector_graph.rs Adds an allow + explanation for a clippy lint where checked_div is not semantically appropriate.
diskann-disk/src/search/provider/disk_provider.rs Removes redundant .into_iter() calls in a zipped result assembly loop.
diskann-benchmark/src/index/search/range.rs Passes Vec<Run<_>> directly into an API expecting IntoIterator.
diskann-benchmark/src/index/search/knn.rs Same as above for KNN search variants.
diskann-benchmark-runner/src/internal/regression.rs Removes redundant .into_iter() on a Vec used in zip.
agents.md Updates the documented “Last Updated” toolchain reference to Rust 1.95.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@harsha-simhadri
harsha-simhadri marked this pull request as draft July 15, 2026 18:51
@hildebrandmw

Copy link
Copy Markdown
Contributor

CI failure is because of the compile tests in diskann-quantization. I've audited the results and it's fine. Running

TRYBUILD=overwrite cargo test --package diskann-quantization compile_tests

should fix the issue.

Regarding the update - we should eventually have a policy regarding minimum Rust version. Current stable - 2 (so in this case, 1.95) is a decent policy. It allows our users some slack while still allowing us to (eventually) get shiny new features.

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.

3 participants