Skip to content

feat: support no_std consumers with embedded CI coverage - #161

Draft
robjtede wants to merge 3 commits into
mainfrom
thoguhts-on-this-httpsgithubcomx52devcontractsissues
Draft

feat: support no_std consumers with embedded CI coverage#161
robjtede wants to merge 3 commits into
mainfrom
thoguhts-on-this-httpsgithubcomx52devcontractsissues

Conversation

@robjtede

@robjtede robjtede commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

Document support for no_std consumers and verify it with a separate ensure-no-alloc binary, following the approach in robjtede/impl-more. The generated contracts already work without std or an allocator, so no code generator changes are required.

Add just build-no-alloc and a stable CI build for thumbv6m-none-eabi. The fixture covers combined contracts, impl invariants, old(), trait contracts, and debug and test attributes. A second build enables cfg(test) without the standard test harness to check test-only assertions. Logging and MIRAI integrations remain outside the documented guarantee.

Closes #160.

Validation

  • just toolchain=+stable build-no-alloc passed both embedded builds.
  • nix develop -c just test-no-coverage passed 35 tests, 12 doctests, and documentation checks.
  • nix develop -c just clippy passed.
  • Clippy for the embedded fixture passed with warnings denied.
  • Rust, Just, Markdown, YAML, and TOML formatting checks passed after formatting the README.

The embedded fixture was compiled and linked, not run on hardware.

The fixture deliberately has no global allocator. As a negative control, temporarily adding extern crate alloc made the embedded build fail with a missing-global-allocator error. Both builds passed again after removing it.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

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.

Official support for no_std

1 participant