Skip to content

chore: silence false-positive dead_code warnings#57

Merged
aguilar1x merged 1 commit into
devfrom
chore/silence-factory-dead-code-warnings
Jun 5, 2026
Merged

chore: silence false-positive dead_code warnings#57
aguilar1x merged 1 commit into
devfrom
chore/silence-factory-dead-code-warnings

Conversation

@aguilar1x
Copy link
Copy Markdown
Contributor

@aguilar1x aguilar1x commented Jun 5, 2026

Summary

The vc-vault-factory crate emitted 16 never used warnings on the native build. All are false positives: the Soroban contract macros (#[contract], #[contractclient], #[contractimpl]) generate the entrypoints (deploy / deploy_sponsored / is_vault), so the native dead-code linter can't see that the helper / storage / event functions are reachable through them.

Every flagged item has a real call site, and the WASM build (the real target) reports 0 warnings.

Change

Add crate-level #![allow(dead_code)] to contracts/vc-vault-factory/src/lib.rs, matching the pattern already used in vc-vault's lib.rs.

Evidence (0 dead code)

Item defined called
derive_salt contract.rs:35 contract.rs:52
deploy_vault contract.rs:50 contract.rs:67, :75
extend_instance storage.rs:24 contract.rs:66, :74, :81
get_vault_init_meta storage.rs:36 contract.rs:51
set_deployed storage.rs:43 contract.rs:58
is_deployed storage.rs:53 contract.rs:82
vault_deployed / sponsored_vault_deployed events.rs:16, :24 contract.rs:68, :76

The crate emitted 16 "never used" warnings on the native build. All are
false positives: the Soroban contract macros generate the entrypoints
(deploy / deploy_sponsored / is_vault), so the native dead-code linter
can't see that the helper/storage/event fns are reachable. Every item
has a real call site and the WASM build reports 0 warnings.

Add crate-level #![allow(dead_code)], matching vc-vault's lib.rs.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Added a crate-level compiler attribute #![allow(dead_code)] to contracts/vc-vault-factory/src/lib.rs to suppress dead-code warnings. No functional logic or public API changes were made.

Changes

Dead-code warning suppression

Layer / File(s) Summary
Crate-level warning directive
contracts/vc-vault-factory/src/lib.rs
The #![allow(dead_code)] attribute is added at lines 3–4 to silence compiler warnings for unused code in the crate.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

🐰 Hop hop, a warning quashed with care,
The allow attribute hops through the air,
Dead code whispers now kept at bay,
The compiler grins and hops away!
Let's tunnel forward to brighter days! 🍕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'chore: silence false-positive dead_code warnings' accurately summarizes the main change—adding a crate-level attribute to suppress dead-code warnings. It is concise, clear, and directly related to the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/silence-factory-dead-code-warnings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aguilar1x aguilar1x changed the title chore(vc-vault-factory): silence false-positive dead_code warnings chore: silence false-positive dead_code warnings Jun 5, 2026
@aguilar1x aguilar1x self-assigned this Jun 5, 2026
@aguilar1x aguilar1x merged commit b813345 into dev Jun 5, 2026
3 checks passed
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.

1 participant