chore: triage dead_code-family warnings (#854) - #2320
Merged
Conversation
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.
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.
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)sweep,trace_array/object/closure,gc_type_*,validate_gc_type_*. These back thePERRY_GEN_GC=0full mark-sweep bisection path and are exercised bygc/tests.nanbox_pointer_f64,box_ptr(documented value-encoding contract, see CLAUDE.md).publish/server_api,perry.tomlconfig structs, OAuth responses. Not every field is read on every path; used field-level allows so noderive(Deserialize/Debug/Clone)is broken.read_registry_kits_root_10, android-onlypath_str_for_log).What was deleted (self-contained, zero refs)
let blklocal inperry-codegen/src/expr/calls.rs(immediately re-bound in the inner block).#[cfg(feature = "websocket")]js_ws_process_pendingextern decl inasync_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 --release→ 0dead_code-family warnings (down from ~99), exit 0.rustfmt --checkpasses on all 54 changed files.Notes for the maintainer
Cargo.toml/CLAUDE.mdversion or touchCHANGELOG.md— fold those in at merge.RedisClient.url(mirrors aURLSside-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.