Skip to content

Enable clippy::clone_on_ref_ptr lint and fix all violations#7340

Closed
joseph-isaacs wants to merge 1 commit into
vortex-data:developfrom
joseph-isaacs:ji/lint-clone-on-ref-ptr-v2
Closed

Enable clippy::clone_on_ref_ptr lint and fix all violations#7340
joseph-isaacs wants to merge 1 commit into
vortex-data:developfrom
joseph-isaacs:ji/lint-clone-on-ref-ptr-v2

Conversation

@joseph-isaacs
Copy link
Copy Markdown
Contributor

Summary

  • Adds clone_on_ref_ptr = "deny" to [workspace.lints.clippy] in the root Cargo.toml
  • Fixes all ~450 violations across 126 files by replacing x.clone() on Arc/Rc/Weak with explicit Arc::clone(&x) (or turbofish Arc::<T>::clone(&x) where type coercion is needed)
  • No #[allow] suppressions anywhere

This makes ref-count bumps visually distinct from deep clones, improving code readability.

Test plan

  • cargo clippy --all-targets --all-features passes with zero errors/warnings
  • cargo +nightly fmt --all applied
  • cargo xtask public-api regenerated
  • No #[allow(clippy::clone_on_ref_ptr)] anywhere in the codebase

🤖 Generated with Claude Code

Adds `clone_on_ref_ptr = "deny"` to workspace clippy lints, enforcing
explicit `Arc::clone(&x)` instead of `x.clone()` on ref-counted pointers
to make refcount bumps visually distinct from deep clones.

Signed-off-by: Joseph Isaacs <joseph@spiraldb.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 8, 2026

Merging this PR will improve performance by 20.72%

⚡ 1 improved benchmark
✅ 1121 untouched benchmarks
⏩ 1530 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 60.2 µs 49.9 µs +20.72%

Comparing joseph-isaacs:ji/lint-clone-on-ref-ptr-v2 (5b00928) with develop (bbb371c)

Open in CodSpeed

Footnotes

  1. 1530 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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