Skip to content

chore: triage dead_code-family warnings (#854) - #2320

Merged
proggeramlug merged 1 commit into
mainfrom
chore/854-deadcode
May 29, 2026
Merged

chore: triage dead_code-family warnings (#854)#2320
proggeramlug merged 1 commit into
mainfrom
chore/854-deadcode

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Closes #854. Triages the ~99 dead_code-family warnings (fields/variants/functions/methods/constants/statics never used, plus a few unused locals) that were carved out of the warning-cleanup effort.

Per the issue's guidance, each site got case-by-case judgment with a conservative bias: symbols that are part of an externally-meaningful contract or an in-progress subsystem are kept with #[allow(dead_code)] + a // #854: one-line justification rather than deleted. Only genuine, self-contained cruft was removed.

What was kept (with #[allow(dead_code)] + reason)

  • GC fallback / verification pathssweep, trace_array/object/closure, gc_type_*, validate_gc_type_*. These back the PERRY_GEN_GC=0 full mark-sweep bisection path and are exercised by gc/tests.
  • NaN-boxing / value-encoding helpersnanbox_pointer_f64, box_ptr (documented value-encoding contract, see CLAUDE.md).
  • In-progress subsystems — native-ABI, typed-feedback, buffer-view, pod-record taxonomy variants/helpers whose emit sites aren't wired yet.
  • Deserialized wire shapespublish/server_api, perry.toml config structs, OAuth responses. Not every field is read on every path; used field-level allows so no derive(Deserialize/Debug/Clone) is broken.
  • cfg-gated / FFI surface live only on other targets (e.g. read_registry_kits_root_10, android-only path_str_for_log).

What was deleted (self-contained, zero refs)

  • A shadowed let blk local in perry-codegen/src/expr/calls.rs (immediately re-bound in the inner block).
  • An unused #[cfg(feature = "websocket")] js_ws_process_pending extern decl in async_bridge.rs (the drain path has its own decl).

Unused locals that are pure derived values were _-prefixed (_is_library_output, _promise_resolve, _call, _callee_expr, _keys_array, _path_str_for_log).

Validation

  • cargo build --release0 dead_code-family warnings (down from ~99), exit 0.
  • rustfmt --check passes on all 54 changed files.
  • No file-level deletions; net diff is +274 / −12 across 54 files (almost entirely attribute + comment additions).

Notes for the maintainer

  • Per the worktree-PR convention, this branch does not bump Cargo.toml/CLAUDE.md version or touch CHANGELOG.md — fold those in at merge.
  • A handful of fields look like genuinely redundant duplicated state (flagged in code review, not acted on here): RedisClient.url (mirrors a URLS side-map), LoweringContext.next_global_id/globals (globals tracked elsewhere), ClassSpecRequest.new_name (driver re-derives the name). Left as #[allow] for a future cleanup rather than risk behavior changes.

Resolves the ~99 dead_code-family warnings (fields/variants/functions/
methods/constants/statics never used, plus a few unused locals) carved out
of the warning-cleanup effort.

Bias was conservative: symbols that are part of an externally-meaningful
contract or an in-progress subsystem are kept with `#[allow(dead_code)]` and
a `// #854:` one-line justification rather than deleted. This covers:

- GC full mark-sweep fallback + type-metadata verification paths
  (sweep, trace_*, gc_type_*, validate_gc_type_*) — exercised by gc/tests
  and the PERRY_GEN_GC=0 bisection path.
- NaN-boxing / value-encoding helpers (nanbox_pointer_f64, box_ptr).
- In-progress native-ABI / typed-feedback / buffer-view / pod-record
  subsystems whose emit sites are not wired yet.
- Deserialized wire-shape structs (publish/server_api, perry.toml config,
  OAuth responses) where not every field is read on every path — field-level
  allows that never break a derive.
- cfg-gated and FFI surface that is only live on other targets.

A few genuine leftovers were removed instead (self-contained, zero refs):
- a shadowed `let blk` local in codegen expr/calls.rs
- an unused cfg(websocket) `js_ws_process_pending` extern decl
Unused locals that are pure derived values were `_`-prefixed.

Build is clean: `cargo build --release` produces zero dead_code-family
warnings; `rustfmt --check` passes on all changed files.
@proggeramlug
proggeramlug merged commit 497f93a into main May 29, 2026
11 checks passed
@proggeramlug
proggeramlug deleted the chore/854-deadcode branch May 29, 2026 05:23
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.

chore: triage dead-code warnings (fields, variants, constants, dead assignments)

1 participant