Macro ffi_support::static_assert[][src]

macro_rules! static_assert {
    ($ASSERT_NAME:ident, $test:expr) => { ... };
}

Force a compile error if the condition is not met. Requires a unique name for the assertion for… reasons. This is included mainly because it’s a common desire for FFI code, but not for other sorts of code.

Examples

Failing example:

ffi_support::static_assert!(THIS_SHOULD_FAIL, false);

Passing example:

ffi_support::static_assert!(THIS_SHOULD_PASS, true);