fix(lint): clear the clippy backlog the revived Rust CI exposed - #361
Merged
Conversation
Second wave of fallout from reviving Rust CI. With `clippy --all-targets -- -D warnings`
running for the first time, the workspace failed crate after crate. All fixed here;
`cargo clippy --all-targets -- -D warnings` now exits 0.
Mechanical, behaviour-preserving:
- `derivable_impls` — `impl Default for Visibility` -> `#[derive(Default)]` + `#[default]`
- `manual_try_fold` (x2) — `.fold(Ok(acc), ..)` -> `.try_fold(acc, ..)` in both the surface
and core parsers' statement-sequence desugaring
- `collapsible_if` (x2), `match_like_matches_macro` — via `cargo clippy --fix`
- `ptr_arg` — `&PathBuf` -> `&Path` in two ephapax-cli signatures
- `unnecessary_unsafe` — removed an EMPTY `unsafe {}` block that wrapped only comments
in a placeholder test (`ephapax-runtime::list`). Worth noting in
a language whose thesis is memory safety.
Deliberately allowed, each with an inline reason rather than a blanket crate-level allow:
- `approx_constant` — `lex("3.14")` is a float literal UNDER TEST, not an approximation
of PI
- `type_complexity` — introduced a `TokenPredicate` type alias instead
- `too_many_arguments` (x3) — 8 params against clippy's default threshold of 7, on
option-heavy CLI entry points and the recursive import resolver
- `large_enum_variant` — `Value::Closure` is ~264 bytes vs ~48 for the next largest, so
every `Value` pays for it. The fix is to box the payload, which
touches every construction and match site in the INTERPRETER.
That is a behavioural-risk refactor and does not belong inside a
CI-infrastructure change, so it is allowed here with a comment
and tracked in #360.
Verification, all local and all green:
cargo check --locked --all-targets ok
cargo clippy --all-targets -- -D warnings exit 0
cargo fmt --all -- --check clean
cargo test --workspace 285 passed, 0 failed
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hyperpolymath
marked this pull request as ready for review
July 27, 2026 18:35
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 main is currently red
PR #358 revived Rust CI. It merged before this commit landed on the branch, so main
now has a working Rust CI that immediately fails its
Cargo check + clippy + fmtstep.That is not a regression — it is the gate doing its job for the first time since
2026-06-27. This PR is the backlog it found.
Current state of the revived gate on main (
d7f1b49):What this fixes
cargo clippy --all-targets -- -D warningsfailed crate after crate. All resolved;it now exits 0.
Mechanical, behaviour-preserving:
derivable_implsimpl Default for Visibility→#[derive(Default)]+#[default]manual_try_fold×2.fold(Ok(acc), ..)→.try_fold(acc, ..)in the surface and core parsers' statement-sequence desugaringcollapsible_if×2,match_like_matches_macrocargo clippy --fixptr_arg&PathBuf→&Pathin twoephapax-clisignaturesunnecessary_unsafeunsafe {}block wrapping only comments in a placeholder testThat last one is worth a second look in a language whose entire thesis is memory safety:
ephapax-runtime::list::tests::test_list_newcontainedunsafe { /* comments only */ }.Deliberately allowed, each with an inline reason (no blanket crate-level allow):
approx_constant—lex("3.14")is a float literal under test, not an approximation of PItype_complexity— replaced with aTokenPredicatetype aliastoo_many_arguments×3 — 8 params vs clippy's default threshold of 7, on option-heavy CLIentry points and the recursive import resolver
large_enum_variant—Value::Closureis ~264 bytes vs ~48 for the next largest, so everyValuepays for it. The real fix is boxing the payload, which touches every constructionand match site in the interpreter. That is a behavioural-risk refactor that does not
belong in a CI-infrastructure change. Allowed here with a comment, tracked in clippy: box the
Value::Closurepayload (large_enum_variant, currently allowed) #360.Verification — all local, all green
The 285 passing tests matter here: the
try_foldrewrites and theunsaferemoval are theonly changes that could alter behaviour, and the parser/interpreter suites cover both.
🤖 Generated with Claude Code