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.
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
stdcontexts. Now I'm working on ano_stdproject and I'm considering usingcontractsthere 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_stdconsumers: the crate itself is a procedural macro, and the generated checks appear to rely onassert!,debug_assert!,concat!, andstringify!, which are available fromcore.Would it make sense to officially support
no_stdby adding a CI check for it?I think
no_stdis 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.