There are 22 reachability warnings flagged by cargo build --release that need per-site review:
- 21 ×
unreachable pattern
- 1 ×
unreachable expression (plus a few unreachable statement mixed in)
Why per-site review
Each unreachable pattern is one of two things:
- A redundant catch-all after the previous arms already cover all cases → safe to delete.
- A real bug where an earlier arm absorbs cases that were meant to land in this branch.
Without reading each case, removing them risks discarding intentional fall-throughs or silently changing behavior. unreachable expression warnings (code after return/throw) have the same flavor.
Sites
crates/perry-codegen-js/src/emit.rs:2675
crates/perry-codegen-js/src/emit.rs:2680
crates/perry-codegen-js/src/emit.rs:2686
crates/perry-codegen-js/src/emit.rs:3414
crates/perry-codegen/src/collectors.rs:5156
crates/perry-codegen/src/expr.rs:7283
crates/perry-codegen/src/stmt.rs:1105
crates/perry-codegen/src/type_analysis.rs:902
crates/perry-hir/src/analysis.rs:1039
crates/perry-hir/src/lower.rs:6478
crates/perry-hir/src/lower.rs:8270
crates/perry-hir/src/lower/expr_assign.rs:226
crates/perry-hir/src/lower/expr_call.rs:4095
crates/perry-hir/src/lower/expr_call.rs:4105
crates/perry-hir/src/lower/expr_call.rs:4115
crates/perry-hir/src/lower_decl.rs:5340
crates/perry-jsruntime/src/modules.rs:1175
crates/perry-runtime/src/fs.rs:797
crates/perry-runtime/src/object.rs:6173
crates/perry-runtime/src/object.rs:6462
crates/perry-transform/src/deforest.rs:1525
crates/perry/src/commands/publish.rs:2469
Full list reproducible via:
cargo build --release 2>&1 | grep -A1 "unreachable"
How to approach
- For each site, look at the preceding match arms.
- Decide:
- If the wildcard truly is unreachable → delete it (and the warning).
- If an earlier arm absorbs cases that should have landed here → fix the earlier arm, then the wildcard becomes reachable again.
- Run the gap-test suite (
./run_parity_tests.sh) after changes to catch behavioral regressions.
Context
Carved out of the warning-cleanup PR (chore: reduce compile warnings 325 → 125). The mechanical fixes there were guaranteed-no-op; these warnings require judgment per site.
There are 22 reachability warnings flagged by
cargo build --releasethat need per-site review:unreachable patternunreachable expression(plus a fewunreachable statementmixed in)Why per-site review
Each
unreachable patternis one of two things:Without reading each case, removing them risks discarding intentional fall-throughs or silently changing behavior.
unreachable expressionwarnings (code afterreturn/throw) have the same flavor.Sites
Full list reproducible via:
How to approach
./run_parity_tests.sh) after changes to catch behavioral regressions.Context
Carved out of the warning-cleanup PR (
chore: reduce compile warnings 325 → 125). The mechanical fixes there were guaranteed-no-op; these warnings require judgment per site.