3 stable releases
| 2.0.0 | Dec 2, 2021 |
|---|---|
| 1.0.1 | Apr 22, 2020 |
| 1.0.0 | Apr 21, 2020 |
#320 in No standard library
46 downloads per month
Used in 2 crates
4KB
Simple static_assert macro for compile time assertions
Uses const_panic within const variable to produce compile error hence only usable in const context.
Usage
use sa::static_assert;
static_assert!(1 == 1);
static_assert!(1 == 1, "Must be equal");
use sa::static_assert;
static_assert!(0 == 1, "Must be equal"); //should fail
use sa::static_assert;
static_assert!(0 == 1); //should fail
static-assert
Simple static_assert macro for compile time assertions.
Uses const_panic within const variable to produce compile error hence only usable in const context
Requirements
- Rust 1.57