x52dev / x52dev/contracts

Official support for no_std

Open Beginner friendly
#160 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
51
Forks
2
Avg merge
2h 29m
Merged PRs (30d)
6

Description

Hi! I found this library after looking for a stable alternative to the unstable contracts API in core::contracts (https://doc.rust-lang.org/core/contracts/index.html)

I really like this crate and I have already used it quite a bit in std contexts. Now I'm working on a no_std project and I'm considering using contracts there as well.

As far as I can tell from the generated code, the regular contract modes seem like they should already be compatible with no_std consumers: the crate itself is a procedural macro, and the generated checks appear to rely on assert!, debug_assert!, concat!, and stringify!, which are available from core.

Would it make sense to officially support no_std by adding a CI check for it?

I think no_std is an important use case here, since contracts are closer to a language feature than to a typical library feature. In other words, they can be useful even in environments without an OS or the standard library.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the generated contract code and the repository's CI configuration. Check whether the regular contract modes compile for a no_std consumer, then add a CI check if needed; done means the no_std check passes reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ci-cd
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.