Skip to content

feat(detector): flag unused contracterror variants (#677) - #1009

Open
woahwhattheheck wants to merge 2 commits into
Centurylong:mainfrom
woahwhattheheck:fix/grantfox677-dead-contracterror-20261008-r3
Open

woahwhattheheck wants to merge 2 commits into
Centurylong:mainfrom
woahwhattheheck:fix/grantfox677-dead-contracterror-20261008-r3

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Oct 8, 2026 •

Copy link
Copy Markdown

Closes #677

Detector: unused #[contracterror] variants

This is the existing original-contributor implementation from @woahwhattheheck's source branch, now updated in place at head 10999d71fcb910063c69d839c536c2612a55f3c2.

  • Adds dead_contracterror_variant detection for variants without source-local references.
  • Conservatively handles qualified names, impl Self paths, imports and macro tokens to avoid inappropriate removal warnings.
  • Registers the rule and documents the finding code and public-ABI caveat.
  • Completes the detector index and differential-corpus mapping, and removes an unnecessary allocation from the impl comparison.
  • The focused inline snapshot and two related rule cases passed in the retained exact-patch execution: rule cases 3/3, detector-doc coverage 3/3, and differential tests 5/5. The published repair reproduces the accepted patch's three file postimages; no tests or builds were rerun during publication. This does not assert a green full-suite CI result.

This is an advisory source-local rule, not an interprocedural proof that an exported ABI variant is unused.

Original contributor / bounty claim

/claim #677

I, @woahwhattheheck (GitHub ID 293286387), submit and claim this original GitHub contribution for issue #677 and affirmatively request review and any applicable GrantFox OSS / Third Campaign reward, payment, and payout attribution upon acceptance. The issue is tagged Maybe Rewarded; the amount, eligibility, award, acceptance, and payment have not been verified. I do not waive or relinquish any eligible compensation.

@github-actions github-actions Bot added rust Pull requests that update rust code area: core-engine sanctifier-core static analysis engine area: docs Documentation and guides size/m labels Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core-engine sanctifier-core static analysis engine area: docs Documentation and guides area: testing Tests, benchmarks, fuzzing rust Pull requests that update rust code size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detector: Dead / unused contract error variants

1 participant