Skip to content

Cache two more Clippy passes per module - #50

Merged
charliermarsh merged 2 commits into
charlie/1.98/incremental-clippy-source-inputsfrom
charlie/1.98/incremental-clippy-next-passes
Aug 30, 2026
Merged

charliermarsh merged 2 commits into
charlie/1.98/incremental-clippy-source-inputsfrom
charlie/1.98/incremental-clippy-next-passes

Conversation

@charliermarsh

Copy link
Copy Markdown
Collaborator

Cache UnnecessaryWraps and NeedlessBorrowsForGenericArgs through the existing module lint queries, bringing the audited set to 56 passes covering 62 lint kinds. This builds on #49 and uses the source-file input support from astral-experiments/ohm-rust#73.

Track the source span actually read when constructing a suggestion, including after walking macro contexts. The borrower-analysis stack remains local to each module traversal and its nested bodies. Compilers without the source-input query retain whole-crate traversal.

Six paired Ruff edits with identical preparation and unprofiled release builds averaged 36.80s on #49 and 36.39s with this change: 1.1% faster overall, winning four of six pairs. Compiler invocations, flags, and diagnostic payloads matched. This is a small preliminary gain; the no-change Cargo loop remained about 0.32s.

All 13 incremental regressions passed with the matching Ohm compiler, comparing diagnostics and metadata against uncached traversal at one and four compiler threads. The new cases cover cross-module trait changes, nested borrower state, macro suggestion text, configuration, inherited MSRV, and expectations. An untimed observer confirmed that unchanged modules skip callbacks, and a deliberately untracked source edit reproduced stale suggestions. cargo fixit --clippy --Zdangerous-parallel-fixes also produced the same edits and remaining warnings as #49.

@charliermarsh
charliermarsh marked this pull request as ready for review August 30, 2026 14:57
@charliermarsh
charliermarsh merged commit 5bd3512 into charlie/1.98/incremental-clippy-source-inputs Aug 30, 2026
3 checks passed
@charliermarsh
charliermarsh deleted the charlie/1.98/incremental-clippy-next-passes branch August 30, 2026 16:52
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.

1 participant