Skip to content

Official support for no_std #160

Description

@viniciusdutra314

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions