Commit 9288e17
fix(analyzer): clear 4 -Wunused-variable warnings + latent bug
Zero-warnings-policy violations surfaced by the last release build:
analyzer.rs:928 unwrap_threshold (declared, never compared)
analyzer.rs:948 unbounded_vec_patterns (declared, never used)
analyzer.rs:949 unbounded_box_patterns (declared, never used)
analyzer.rs:950 unbounded_string_patterns (declared, never used)
Drops the three `unbounded_*_patterns` locals — they duplicated the
allocation-site count without feeding into any finding (the actual
unbounded-pattern *classification* happens in the
`has_unbounded_allocations` keyword block below).
Fixes the latent `unwrap_threshold` bug: the test-file suppression
branch declared panic_threshold and unwrap_threshold but only ever
compared panic_sites > panic_threshold, then returned
`unwrap_calls` unmodified on the hot branch and `(0, 0)` on the cold
branch. Silently dropped any excessive-unwrap signal in test files.
New behaviour: panic and unwrap axes are evaluated independently via
saturating_sub, so a test file with 30 panics + 5 unwraps now reports
(10, 0) instead of (10, 5) / (0, 0).
Pre-existing test failure surfaced by this fix: readiness.rs's
`readiness_c_assail_detects_unwrap` used a fixture named
`unwrap_test.rs`, which matches the `ends_with("_test.rs")`
is_test_file heuristic. Test was supposed to exercise production-code
PanicPath detection; fixture rename to `unwrap_fixture.rs` makes the
intent match the implementation.
Full test suite: 18/18 readiness, all other targets green, 0
warnings, 0 Clippy pedantic on changed hunk.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b8d177d commit 9288e17
3 files changed
Lines changed: 32 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
924 | 935 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
935 | 941 | | |
936 | 942 | | |
937 | 943 | | |
| |||
943 | 949 | | |
944 | 950 | | |
945 | 951 | | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
953 | 959 | | |
954 | 960 | | |
955 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | | - | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
0 commit comments