Skip to content

Test cfg-gated contracttrait override methods - #1993

Merged
leighmcculloch merged 1 commit into
mainfrom
test-cfg-gated-trait-overrides
Aug 7, 2026
Merged

Test cfg-gated contracttrait override methods#1993
leighmcculloch merged 1 commit into
mainfrom
test-cfg-gated-trait-overrides

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

Extend tests/attributes with regression coverage for three #[cfg] shapes on #[contractimpl(contracttrait)] override methods that no test exercised: stacked cfgs that are all true, the cfg(not(...)) form, and multiple mutually exclusive cfg-gated overrides of the same trait function.

Why

Review feedback on #1760 flagged cfg on trait override methods as an area with unresolved edge cases, and investigation found current main already handles every shape correctly since #1871 — but the multi-override path in derive_contractimpl_trait_default_fns_not_overridden had no test at all, and a deliberate mutation of that loop still passed the suite before this change.

Known limitations

N/A

SemVer Change

  • Major (vX._._) - Breaking change to the public API.
  • Minor (v_.Y._) - Additive change to the public API.
  • Patch (v_._.Z) - No change to the public API.

@leighmcculloch
leighmcculloch requested review from a team and mootz12 August 6, 2026 09:04
@leighmcculloch
leighmcculloch marked this pull request as ready for review August 6, 2026 09:04
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

semver:patch — all changes are confined to tests/ and tests-expanded/, which are test-only crates and not published.

  • cargo semver-checks reports "no semver update required" for all six published crates (soroban-sdk, soroban-sdk-macros, soroban-spec, soroban-spec-rust, soroban-token-sdk, soroban-ledger-snapshot).
  • tests-expanded/ shows new defaulted trait methods added to AttributeTrait and new client methods, but AttributeTrait lives in the unpublished tests/attributes crate — no published API is affected.
  • No Cargo.toml changes (no MSRV, feature, or dependency changes in any published crate).

Nothing was unclear about this classification.

This classification is advisory; the author and reviewer decide the release type.

Generated by Semver Impact for #1993 · sonnet46 · 26.7 AIC · ⌖ 4.06 AIC · ⊞ 8.1K ·

@leighmcculloch
leighmcculloch added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 0c1372a Aug 7, 2026
130 of 131 checks passed
@leighmcculloch
leighmcculloch deleted the test-cfg-gated-trait-overrides branch August 7, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants