Commit 2994db1
authored
fix(lint): clear the clippy backlog the revived Rust CI exposed (#361)
## 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 + fmt` step.
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`):
```
success wasm-tools validate (emitted modules)
success Cargo build + test (ephapax-cli, --no-default-features)
success rust-ci / Detect Cargo.toml
failure rust-ci / Cargo check + clippy + fmt <-- this PR
```
## What this fixes
`cargo clippy --all-targets -- -D warnings` failed crate after crate.
All resolved;
it now exits 0.
**Mechanical, behaviour-preserving:**
| Lint | Fix |
|---|---|
| `derivable_impls` | `impl Default for Visibility` →
`#[derive(Default)]` + `#[default]` |
| `manual_try_fold` ×2 | `.fold(Ok(acc), ..)` → `.try_fold(acc, ..)` in
the surface and core parsers' statement-sequence desugaring |
| `collapsible_if` ×2, `match_like_matches_macro` | via `cargo clippy
--fix` |
| `ptr_arg` | `&PathBuf` → `&Path` in two `ephapax-cli` signatures |
| `unnecessary_unsafe` | removed an **empty** `unsafe {}` block wrapping
only comments in a placeholder test |
That last one is worth a second look in a language whose entire thesis
is memory safety:
`ephapax-runtime::list::tests::test_list_new` contained `unsafe { /*
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 PI
- `type_complexity` — replaced with a `TokenPredicate` type alias
- `too_many_arguments` ×3 — 8 params vs 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 real fix is boxing the payload, which touches
every construction
and 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 **#360**.
## Verification — all local, 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
```
The 285 passing tests matter here: the `try_fold` rewrites and the
`unsafe` removal are the
only changes that could alter behaviour, and the parser/interpreter
suites cover both.
🤖 Generated with [Claude Code](https://claude.com/claude-code)15 files changed
Lines changed: 65 additions & 87 deletions
File tree
- ephapax-linear/src
- src
- ephapax-cli
- src
- tests
- ephapax-desugar/src
- ephapax-interp/src
- ephapax-lexer/src
- ephapax-lsp/src
- ephapax-parser/src
- ephapax-query/src
- ephapax-runtime/src
- ephapax-syntax/src
- ephapax-wasm/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| 574 | + | |
573 | 575 | | |
574 | 576 | | |
575 | 577 | | |
576 | | - | |
| 578 | + | |
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 90 | + | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| |||
2014 | 2011 | | |
2015 | 2012 | | |
2016 | 2013 | | |
2017 | | - | |
| 2014 | + | |
2018 | 2015 | | |
2019 | 2016 | | |
2020 | 2017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
| 587 | + | |
| 588 | + | |
587 | 589 | | |
588 | 590 | | |
589 | 591 | | |
| |||
785 | 787 | | |
786 | 788 | | |
787 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
788 | 793 | | |
789 | 794 | | |
790 | 795 | | |
| |||
891 | 896 | | |
892 | 897 | | |
893 | 898 | | |
894 | | - | |
| 899 | + | |
895 | 900 | | |
896 | 901 | | |
897 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 176 | + | |
181 | 177 | | |
182 | 178 | | |
183 | 179 | | |
| |||
572 | 568 | | |
573 | 569 | | |
574 | 570 | | |
575 | | - | |
| 571 | + | |
576 | 572 | | |
577 | 573 | | |
578 | 574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 290 | + | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
| |||
772 | 770 | | |
773 | 771 | | |
774 | 772 | | |
775 | | - | |
776 | | - | |
| 773 | + | |
777 | 774 | | |
778 | 775 | | |
779 | 776 | | |
| |||
1261 | 1258 | | |
1262 | 1259 | | |
1263 | 1260 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1286 | 1276 | | |
1287 | | - | |
1288 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1289 | 1282 | | |
1290 | 1283 | | |
1291 | | - | |
1292 | 1284 | | |
1293 | 1285 | | |
1294 | 1286 | | |
| |||
2359 | 2351 | | |
2360 | 2352 | | |
2361 | 2353 | | |
2362 | | - | |
| 2354 | + | |
2363 | 2355 | | |
2364 | 2356 | | |
2365 | 2357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 204 | + | |
| 205 | + | |
208 | 206 | | |
209 | 207 | | |
210 | 208 | | |
| |||
507 | 505 | | |
508 | 506 | | |
509 | 507 | | |
510 | | - | |
511 | | - | |
| 508 | + | |
512 | 509 | | |
513 | 510 | | |
514 | 511 | | |
| |||
0 commit comments