coinbase-smt: silence unused-import warnings in both build configs - #239
Merged
Merged
Conversation
Four warnings, in two groups, both from imports whose only users are
conditionally compiled.
`sha2::{Digest, Sha256}` at the crate root is used ONLY by the two
`#[cfg(test)]` modules -- `roots.rs` and `bip30.rs` each carry their
own. Moved into those two modules, matching what bip30.rs already does.
`alloc::vec::Vec` and `roots::bit` are used only by the std-only
`impl Smt`, so they warn on every no_std (guest) build. Gated on
`feature = "std"`.
Verified all four configurations build with zero unused-import
warnings -- std, no_std, test, and the full prover workspace -- and the
27 crate tests still pass. The no_std path is the one that matters:
warnings in a guest-facing crate are where a real one hides.
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.
Four unused-import warnings, in two groups. Both come from imports whose only users are conditionally compiled, so each is only unused in some configurations — which is why they survived.
sha2::{Digest, Sha256}— unused outside testsThe crate-root import's only users are the two
#[cfg(test)]modules (mod tests,mod oracle). Everything non-test that hashes is inroots.rsandbip30.rs, and both already carry their own import. Moved it into the two test modules, matching the patternbip30.rsuses.alloc::vec::Vecandroots::bit— unused underno_stdEvery non-test use of both is inside the
#[cfg(feature = "std")] impl Smtblock, so on a guest (--no-default-features) build they are genuinely unused. Gated onfeature = "std".extern crate allocstays unconditional —roots.rsneeds it.Verification
--no-default-features(guest/no_std)cargo testproverworkspace buildcargo test -p hazync-coinbase-smt— 27 passed, 0 failed.The
no_stdpath is the one worth caring about: this crate is compiled into the guest, and warnings in a guest-facing crate are exactly where a real one goes unnoticed.No functional change — imports only.