clippy: the simplifications a machine can make without changing the code's shape #318

Closed
dcharlot wants to merge 1 commit from tidy/safe-lints into main

2026-10-18

Transaction Science
clippy: the simplifications a machine can make without changing the code's shape
Some checks failed
standards workspaces build + test / proof-rs (proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m33s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m37s
standards workspaces build + test / smart-byte-rs (smart-byte/smart-byte-rs, smart-byte-rs, linux) (pull_request) Successful in 4m31s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 6m54s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m13s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 27s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 2m45s
wai-pack / wai-pack · linux (pull_request) Successful in 2m8s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 21m10s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 31s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 1m27s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 16m49s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m28s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 24m45s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 24m15s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 5m9s
wai-pack / wai-pack · macos (pull_request) Successful in 1m35s
WAI HTTP delivery / HTTP corpus · falsify mutations 0/3 (pull_request) Failing after 3h4m12s
WAI HTTP delivery / HTTP corpus · falsify mutations 2/3 (pull_request) Failing after 3h10m44s
WAI HTTP delivery / HTTP corpus · falsify mutations 1/3 (pull_request) Failing after 3h11m20s
WAI HTTP delivery / HTTP corpus · falsify patches 0/3 (pull_request) Successful in 5m36s
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Successful in 5s
WAI HTTP delivery / HTTP corpus · falsify patches 2/3 (pull_request) Successful in 5m57s
WAI HTTP delivery / HTTP corpus · falsify patches 1/3 (pull_request) Successful in 6m19s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m11s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m14s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 19s
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Successful in 2m43s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m18s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 4m5s
Of 5250 warnings across the seventeen workspaces, these are the ones whose fix
is mechanical and local: a redundant `.into()`, `clone` on a `Copy`, a
derivable `Default`, `useless_vec`, `default_constructed_unit_structs`,
`manual_is_multiple_of`, `uninlined_format_args`. 34 files, 24 lines shorter.

Deliberately NOT in here, because a tidy-up should not decide them:

  The ~2000 cast lints (cast_possible_truncation 914, cast_precision_loss 664,
  cast_sign_loss 236, cast_possible_wrap 186) and ~837 doc-style ones
  (doc_markdown 554, overindented lists 192, lazy continuation 91). In numeric
  code the casts are the work; "fixing" them means 2000 allows or
  try_into().unwrap() churn. With too_many_arguments, type_complexity,
  unused_self and many_single_char_names that is ~3170 of the 5250 -- a question
  about whether these crates carry clippy::pedantic, answered once at crate
  level, not 3170 times at call sites.

  unused_imports (88) and unused_unsafe (81): cfg-dependent here.
  jouleclaw-loader-gguf's `std::ffi::c_void` is behind the `numa` feature and
  its `std::arch::aarch64::*` sits inside an aarch64-gated fn -- dead in this
  configuration, live in another.

  collapsible_if (168): its fix is correct but keeps the old body indentation,
  and this tree is not rustfmt-clean so it cannot be normalised. An earlier
  pass fixed 19 files that way, inspected them and reverted; the lint is now
  excluded up front rather than fixed and undone.

  chunks_exact_to_as_chunks (65), should_implement_trait (34),
  result_large_err (52), needless_range_loop (191): API changes and loop
  rewrites, each wanting its own pass with the tests watched.

Regenerated on current main rather than rebased: six aac-web files were touched
by both this pass and the 71 commits that landed meanwhile, and re-running a
machine pass on the new base is correct by construction where resolving its
conflicts by hand is not. aac needed nothing the second time -- those
simplifications had already landed.

Verified on the build host, every check asserting it did the work rather than
trusting an exit status: all ten touched workspaces' tests pass, `ran == 10`
asserted, and no let-chain appears in the diff.

⚠️ eoc-cascade's `hit_calibration_process_energy` fails intermittently and is
NOT from this change: on clean origin/main with no local modification it went
pass, fail, fail in three consecutive runs. The check above admits it only when
it is the sole failing target, so a second failure in eoc would still fail.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-18 15:30:10 -04:00