Repository navigation
Run Clippy in release mode in CI and fix a release-only unused import - #1516
Merged
Merged
Conversation
Alex Razumov (arrayka)
requested review from
a team
and
a balanced review from Copilot
October 26, 2026 23:15
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes preserve existing CI coverage, align the import guard with its usage, and have no unresolved findings.
No open issues 🎉
What changed in this PR
This PR adds release-mode Clippy checks to DiskANN’s CI and fixes the release-only unused import that motivated the change.
Changes:
- Add release-mode Clippy alongside existing checks, preserving feature and platform coverage.
- Gate the
tracing::debugimport with#[cfg(debug_assertions)]to match its usage.
| File | Description |
|---|---|
diskann-disk/src/build/builder/build.rs |
Conditionally imports debug to avoid release-only warnings. |
.github/workflows/ci.yml |
Adds release-mode Clippy for workspace, feature-specific, and vectorset checks. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1516 +/- ##
==========================================
- Coverage 92.06% 91.03% -1.04%
==========================================
Files 602 602
Lines 124080 124080
==========================================
- Hits 114233 112951 -1282
- Misses 9847 11129 +1282
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
|
Was the dependencies comment meant to go on #1517? |
Mark Hildebrand (hildebrandmw)
approved these changes
Oct 28, 2026
Mark Hildebrand (hildebrandmw)
approved these changes
Oct 30, 2026
Aditya Krishnan (arkrishn94)
approved these changes
Oct 30, 2026
Alex Razumov (arrayka)
added a commit
that referenced
this pull request
Nov 2, 2026
This is a follow-up to #1516. This PR enables `--config "$RUST_CONFIG"` for the baseline versions of llvm-lines and disk-benchmarks.yml. This was intentionally omitted from #1516 because the baseline versions run code from the `main` branch, which did not yet contain the required fixes to enable failures on warnings. Now that #1516 has landed in main, it is safe to enable this for the baseline versions as well.
Suhas Jayaram Subramanya (suhasjs)
pushed a commit
that referenced
this pull request
Nov 3, 2026
…#1516) ## Why CI only ran Clippy with debug assertions enabled, missing a release-only unused import in the disk index builder. ## What - Add release-mode Clippy alongside all existing CI checks, preserving feature and platform coverage. - Fixed RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]': ``` cargo check --locked --offline -p diskann-disk --lib --release --config 'build.rustflags=["-Dwarnings"]' ``` Printed warning: unused import: debug and succeeded (exit 0). ``` cargo check --locked --offline -p diskann-disk --lib --release --config 'target."cfg(all())".rustflags=["-Dwarnings"]' ``` Printed error: unused import: debug, noting that -D unused-imports is implied by -D warnings, and failed (exit 101). - Added missing `--config "$RUST_CONFIG"` to `cargo run`, `cargo build`, `cargo miri`, `cargo llvm-lines`. I intentionally left the baseline versions of llvm-lines and disk-benchmarks.yml untouched, because they compile `main` branch, which still contains unfixed code. - Gate the `tracing::debug` import with `#[cfg(debug_assertions)]` to fix the clippy error in `--release`: ``` cargo clippy --locked --workspace --all-targets --no-deps --release --config 'build.rustflags=["-Dwarnings"]' -- -Dwarnings ... error: unused import: `debug` --> diskann-disk\src\build\builder\build.rs:31:15 | 31 | use tracing::{debug, info}; | ^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` Checking diskann-benchmark v0.61.0 (C:\src\DiskANN2\diskann-benchmark) error: could not compile `diskann-disk` (lib) due to 1 previous error ``` - Fixed a miri-related unused import discovered by the hardenning: ``` error: unused import: `test_util::Check` --> diskann-quantization/src/algorithms/transforms/padding_hadamard.rs:372:41 | 372 | use crate::{alloc::GlobalAllocator, test_util::Check}; | ^^^^^^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` error: variant `Ulp` is never constructed --> diskann-quantization/src/test_util.rs:211:5 | 209 | pub(crate) enum Check { | ----- variant in this enum 210 | /// Assert two floating point numbers are within a set number of ULPs oeachother. 211 | Ulp(usize), | ^^^ | = note: `Check` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis = note: `-D dead-code` implied by `-D warnings` = help: to override `-D warnings` add `#[expect(dead_code)]` or `#[allow(dead_code)]` error: associated function `ulp` is never used --> diskann-quantization/src/test_util.rs:228:25 | 227 | impl Check { | ---------- associated function in this implementation 228 | pub(crate) const fn ulp(ulp: usize) -> Self { | ^^^ ``` ## Next - Add `--config "$RUST_CONFIG"` to baseline versions of llvm-lines and disk-benchmarks.yml - Run manually nightly.yml
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.
Why
CI only ran Clippy with debug assertions enabled, missing a release-only unused import in the disk index builder.
What
Add release-mode Clippy alongside all existing CI checks, preserving feature and platform coverage.
Fixed RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]':
Printed warning: unused import: debug and succeeded (exit 0).
Printed error: unused import: debug, noting that -D unused-imports is implied by -D warnings, and failed (exit 101).
Added missing
--config "$RUST_CONFIG"tocargo run,cargo build,cargo miri,cargo llvm-lines. I intentionally left the baseline versions of llvm-lines and disk-benchmarks.yml untouched, because they compilemainbranch, which still contains unfixed code.Gate the
tracing::debugimport with#[cfg(debug_assertions)]to fix the clippy error in--release:Next
--config "$RUST_CONFIG"to baseline versions of llvm-lines and disk-benchmarks.yml